|
|
@ -109,27 +109,25 @@ namespace Tests.Model_UTs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
Game result = stubGameRunner.GetOneByName("thereisbasicalllynowaythatthisgamenamealreadyexists");
|
|
|
|
Game result = stubGameRunner.GetOneByName("thereisbasicallynowaythatthisgamenamealreadyexists");
|
|
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Assert.Null(result);
|
|
|
|
Assert.Null(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
[Fact]
|
|
|
|
[InlineData("Bob")]
|
|
|
|
public void TestGetOneByNameIfValidThenReturnGame()
|
|
|
|
[InlineData("bob")]
|
|
|
|
|
|
|
|
[InlineData("bob ")]
|
|
|
|
|
|
|
|
[InlineData(" boB ")]
|
|
|
|
|
|
|
|
public void TestGetOneByNameIfValidThenReturnPlayer(string name)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Arrange
|
|
|
|
// Arrange
|
|
|
|
|
|
|
|
GameRunner gameRunner = new(new PlayerManager(), new DieManager());
|
|
|
|
|
|
|
|
Game game = stubGameRunner.GetAll().First();
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
|
|
|
|
Game actual = gameRunner.Add(game);
|
|
|
|
|
|
|
|
Game expected = game;
|
|
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
|
|
|
|
Assert.Equal(expected, actual);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|