Skip to content

Commit

Permalink
test: Add tests for flag counters (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 authored Sep 11, 2024
1 parent 1c0b6ca commit fb98351
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions tests/Application.Tests/Players/Accounts/FlagCounterTests.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit fb98351

Please sign in to comment.