fixed some code smelt
continuous-integration/drone/push Build is passing Details

test_old_branch
Jules LASCRET 11 months ago
parent 974a510aa4
commit 92adef32f4

@ -15,7 +15,7 @@ namespace QwirkleClassLibrary
{ {
if (p == null) if (p == null)
{ {
throw new NullReferenceException("player"); throw new ArgumentNullException(nameof(p), "player cannot be null");
} }
else else
{ PlayerScore = 0; { PlayerScore = 0;

@ -62,7 +62,7 @@ public class TestBoard
{ {
Board board = new Board(12, 12); Board board = new Board(12, 12);
Assert.Equal((12 * 12), board.GetCells().Count()); Assert.Equal((12 * 12), board.GetCells().Count);
} }
[Fact] [Fact]
@ -82,7 +82,7 @@ public class TestBoard
} }
ReadOnlyCollection<Cell> readCells = cells.AsReadOnly(); ReadOnlyCollection<Cell> readCells = cells.AsReadOnly();
Assert.Equal(readCells.Count(), board.GetReadCells().Count()); Assert.Equal(readCells.Count, board.GetReadCells().Count);
} }

@ -8,11 +8,12 @@ public class TestScore
//[InlineData(true)] //[InlineData(true)]
public void Test_CellScoreConstructor(bool except) public void Test_CellScoreConstructor(bool except)
{ {
/*if (!except) if (!except)
{ {
Assert.Throws<ArgumentNullException>(() => new Score(null)); Assert.Throws<ArgumentNullException>(() => new Score(null));
return; return;
}*/ }
Player? p = new Player("test"); Player? p = new Player("test");
Score score = new Score(p); Score score = new Score(p);
Assert.True(true); Assert.True(true);

Loading…
Cancel
Save