From 107c9f5282baaebe71e6f0ef8f83d20060e31a1e Mon Sep 17 00:00:00 2001 From: maxime Date: Tue, 2 Apr 2024 21:33:21 +0200 Subject: [PATCH] add ChangeUserInformation UT --- UnitTests/TacticsControllerTest.cs | 2 +- UnitTests/UserControllerTest.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/UnitTests/TacticsControllerTest.cs b/UnitTests/TacticsControllerTest.cs index b100f72..bbc7efe 100644 --- a/UnitTests/TacticsControllerTest.cs +++ b/UnitTests/TacticsControllerTest.cs @@ -71,7 +71,7 @@ public class TacticsControllerTest { var (controller, context) = GetController(1); var result = await controller.CreateNew(new("Test Tactic", "pLaIn")); - result.Should().BeEquivalentTo(new TacticController.CreateNewResponse(2, 4)); + result.Should().BeEquivalentTo(new TacticController.CreateNewResponse(2, 2)); var tactic = await context.Tactics.FirstOrDefaultAsync(e => e.Id == 2); tactic.Should().NotBeNull(); tactic!.Name.Should().BeEquivalentTo("Test Tactic"); diff --git a/UnitTests/UserControllerTest.cs b/UnitTests/UserControllerTest.cs index cedbad8..3c82d08 100644 --- a/UnitTests/UserControllerTest.cs +++ b/UnitTests/UserControllerTest.cs @@ -83,4 +83,13 @@ public class UsersControllerTest result.Should().BeOfType(); } + [Fact] + public async Task TestChangeUserInformation() + { + var controller = GetUserController(1); + await controller.ChangeUserInformation(new("a", "b", "c", "d")); + var user = await controller.GetUser(); + user.Should().BeEquivalentTo(new User(1, "b", "a", "c", true)); + } + } \ No newline at end of file