Split normal tests from game api tests

This commit is contained in:
jvyden 2021-12-22 22:33:50 -05:00
parent 68eb6aeb3e
commit 1fbabe0000
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
11 changed files with 74 additions and 14 deletions

View file

@ -0,0 +1,30 @@
using System;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Tests;
using LBPUnion.ProjectLighthouse.Types;
using Xunit;
namespace ProjectLighthouse.Tests.GameApiTests
{
public class DatabaseTests : LighthouseServerTest
{
[DatabaseFact]
public async Task CanCreateUserTwice()
{
await using Database database = new();
int rand = new Random().Next();
User userA = await database.CreateUser("createUserTwiceTest" + rand, HashHelper.GenerateAuthToken());
User userB = await database.CreateUser("createUserTwiceTest" + rand, HashHelper.GenerateAuthToken());
Assert.NotNull(userA);
Assert.NotNull(userB);
await database.RemoveUser(userA); // Only remove userA since userA and userB are the same user
await database.SaveChangesAsync();
}
}
}