From 9479dca411b2f8f00322cb93e2b71e2c79a27c14 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 2 Nov 2021 21:37:55 -0400 Subject: [PATCH] Properly clean up users & slots in SlotTests and DatabaseTests --- ProjectLighthouse.Tests/Tests/DatabaseTests.cs | 10 ++++++++-- ProjectLighthouse.Tests/Tests/SlotTests.cs | 5 +++++ ProjectLighthouse.sln.DotSettings | 4 ++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs index 90551c5d..f2071792 100644 --- a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs +++ b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Types; namespace LBPUnion.ProjectLighthouse.Tests { @@ -11,8 +12,13 @@ namespace LBPUnion.ProjectLighthouse.Tests await using Database database = new(); int rand = new Random().Next(); - await database.CreateUser("createUserTwiceTest" + rand); - await database.CreateUser("createUserTwiceTest" + rand); + User userA = await database.CreateUser("createUserTwiceTest" + rand); + User userB = await database.CreateUser("createUserTwiceTest" + rand); + + database.Users.Remove(userA); + database.Users.Remove(userB); + + await database.SaveChangesAsync(); } } } \ No newline at end of file diff --git a/ProjectLighthouse.Tests/Tests/SlotTests.cs b/ProjectLighthouse.Tests/Tests/SlotTests.cs index ae5a8b9b..30483771 100644 --- a/ProjectLighthouse.Tests/Tests/SlotTests.cs +++ b/ProjectLighthouse.Tests/Tests/SlotTests.cs @@ -57,6 +57,11 @@ namespace LBPUnion.ProjectLighthouse.Tests database.Slots.Remove(slotA); database.Slots.Remove(slotB); + + database.Users.Remove(userA); + database.Users.Remove(userB); + + await database.SaveChangesAsync(); } } } \ No newline at end of file diff --git a/ProjectLighthouse.sln.DotSettings b/ProjectLighthouse.sln.DotSettings index bca9c610..9cc7db0b 100644 --- a/ProjectLighthouse.sln.DotSettings +++ b/ProjectLighthouse.sln.DotSettings @@ -1,4 +1,7 @@  + True + FullFormat + True HINT HINT SUGGESTION @@ -7,6 +10,7 @@ SUGGESTION WARNING ERROR + True ExpressionBody ExpressionBody Field, Property, Event, Method