diff --git a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs index 01d49d1f..9c45708d 100644 --- a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs +++ b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs @@ -16,8 +16,8 @@ namespace LBPUnion.ProjectLighthouse.Tests User userA = await database.CreateUser("createUserTwiceTest" + rand, HashHelper.GenerateAuthToken()); User userB = await database.CreateUser("createUserTwiceTest" + rand, HashHelper.GenerateAuthToken()); - database.Users.Remove(userA); - database.Users.Remove(userB); + await database.RemoveUser(userA); + await database.RemoveUser(userB); await database.SaveChangesAsync(); } diff --git a/ProjectLighthouse.Tests/Tests/SlotTests.cs b/ProjectLighthouse.Tests/Tests/SlotTests.cs index 7af3d264..761583e9 100644 --- a/ProjectLighthouse.Tests/Tests/SlotTests.cs +++ b/ProjectLighthouse.Tests/Tests/SlotTests.cs @@ -79,8 +79,8 @@ namespace LBPUnion.ProjectLighthouse.Tests database.Slots.Remove(slotA); database.Slots.Remove(slotB); - database.Users.Remove(userA); - database.Users.Remove(userB); + await database.RemoveUser(userA); + await database.RemoveUser(userB); await database.SaveChangesAsync(); } diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index e28957ba..25a9fb23 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -277,6 +277,8 @@ namespace LBPUnion.ProjectLighthouse this.Comments.RemoveRange(this.Comments.Where(c => c.PosterUserId == user.UserId)); this.Photos.RemoveRange(this.Photos.Where(p => p.CreatorId == user.UserId)); + this.Users.Remove(user); + await this.SaveChangesAsync(); }