mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-13 00:31:28 +00:00
Split normal tests from game api tests
This commit is contained in:
parent
68eb6aeb3e
commit
1fbabe0000
11 changed files with 74 additions and 14 deletions
30
ProjectLighthouse.Tests.GameApiTests/DatabaseTests.cs
Normal file
30
ProjectLighthouse.Tests.GameApiTests/DatabaseTests.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue