|
|
@ -19,27 +19,16 @@ namespace Tests.Model_UTs
|
|
|
|
Assert.Equal("Alice", player.Name);
|
|
|
|
Assert.Equal("Alice", player.Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Theory]
|
|
|
|
public void TestConstructorIfWhitespaceThenException()
|
|
|
|
[InlineData("")]
|
|
|
|
{
|
|
|
|
[InlineData(" ")]
|
|
|
|
// Arrange
|
|
|
|
public void TestConstructorIfWhitespaceOrBlankThenException(string name)
|
|
|
|
Player player;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
|
|
|
void action() => player = new(" ");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
|
|
|
Assert.Throws<ArgumentException>(action);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void TestConstructorIfBlankThenException()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Arrange
|
|
|
|
// Arrange
|
|
|
|
Player player;
|
|
|
|
Player player;
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
void action() => player = new("");
|
|
|
|
void action() => player = new(name);
|
|
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Assert.Throws<ArgumentException>(action);
|
|
|
|
Assert.Throws<ArgumentException>(action);
|
|
|
|