diff --git a/Qwirkle/QwirkleClassLibrary/Score.cs b/Qwirkle/QwirkleClassLibrary/Score.cs index db38754..ff52f78 100644 --- a/Qwirkle/QwirkleClassLibrary/Score.cs +++ b/Qwirkle/QwirkleClassLibrary/Score.cs @@ -15,7 +15,7 @@ namespace QwirkleClassLibrary { if (p == null) { - throw new NullReferenceException("player"); + throw new ArgumentNullException(nameof(p), "player cannot be null"); } else { PlayerScore = 0; diff --git a/Qwirkle/TestBase/TestBoard.cs b/Qwirkle/TestBase/TestBoard.cs index f56f181..2ad505c 100644 --- a/Qwirkle/TestBase/TestBoard.cs +++ b/Qwirkle/TestBase/TestBoard.cs @@ -62,7 +62,7 @@ public class TestBoard { Board board = new Board(12, 12); - Assert.Equal((12 * 12), board.GetCells().Count()); + Assert.Equal((12 * 12), board.GetCells().Count); } [Fact] @@ -82,7 +82,7 @@ public class TestBoard } ReadOnlyCollection readCells = cells.AsReadOnly(); - Assert.Equal(readCells.Count(), board.GetReadCells().Count()); + Assert.Equal(readCells.Count, board.GetReadCells().Count); } diff --git a/Qwirkle/TestBase/TestScore.cs b/Qwirkle/TestBase/TestScore.cs index 0b98fc5..ea8efd2 100644 --- a/Qwirkle/TestBase/TestScore.cs +++ b/Qwirkle/TestBase/TestScore.cs @@ -8,11 +8,12 @@ public class TestScore //[InlineData(true)] public void Test_CellScoreConstructor(bool except) { - /*if (!except) + if (!except) { Assert.Throws(() => new Score(null)); return; - }*/ + } + Player? p = new Player("test"); Score score = new Score(p); Assert.True(true);