From fb9835180f3c0f6d3a80f8ad0e45e1ad7cad7764 Mon Sep 17 00:00:00 2001 From: Dave Roman <43916038+MrDave1999@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:03:19 -0500 Subject: [PATCH] test: Add tests for flag counters (#76) --- .../Players/Accounts/FlagCounterTests.cs | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tests/Application.Tests/Players/Accounts/FlagCounterTests.cs diff --git a/tests/Application.Tests/Players/Accounts/FlagCounterTests.cs b/tests/Application.Tests/Players/Accounts/FlagCounterTests.cs new file mode 100644 index 00000000..59cbbdda --- /dev/null +++ b/tests/Application.Tests/Players/Accounts/FlagCounterTests.cs @@ -0,0 +1,64 @@ +namespace CTF.Application.Tests.Players.Accounts; + +public class FlagCounterTests +{ + [Test] + public void AddBroughtFlags_WhenCalledTwice_ShouldBeIncreasedTo2() + { + // Arrange + var player = new PlayerInfo(); + int expected = 2; + + // Act + player.AddBroughtFlags(); + player.AddBroughtFlags(); + + // Assert + player.BroughtFlags.Should().Be(expected); + } + + [Test] + public void AddCapturedFlags_WhenCalledTwice_ShouldBeIncreasedTo2() + { + // Arrange + var player = new PlayerInfo(); + int expected = 2; + + // Act + player.AddCapturedFlags(); + player.AddCapturedFlags(); + + // Assert + player.CapturedFlags.Should().Be(expected); + } + + [Test] + public void AddDroppedFlags_WhenCalledTwice_ShouldBeIncreasedTo2() + { + // Arrange + var player = new PlayerInfo(); + int expected = 2; + + // Act + player.AddDroppedFlags(); + player.AddDroppedFlags(); + + // Assert + player.DroppedFlags.Should().Be(expected); + } + + [Test] + public void AddReturnedFlags_WhenCalledTwice_ShouldBeIncreasedTo2() + { + // Arrange + var player = new PlayerInfo(); + int expected = 2; + + // Act + player.AddReturnedFlags(); + player.AddReturnedFlags(); + + // Assert + player.ReturnedFlags.Should().Be(expected); + } +}