diff --git a/Qwirkle/QwirkleClassLibrary/Score.cs b/Qwirkle/QwirkleClassLibrary/Score.cs index 60adc70..c47bff0 100644 --- a/Qwirkle/QwirkleClassLibrary/Score.cs +++ b/Qwirkle/QwirkleClassLibrary/Score.cs @@ -13,9 +13,9 @@ namespace QwirkleClassLibrary public Score(Player p) { - if(p == null) + if(p==null) { - throw new ArgumentException(p.ToString()); + throw new ArgumentException(); } score = 0; playerTag = p.NameTag; diff --git a/Qwirkle/TestBase/TestBoard.cs b/Qwirkle/TestBase/TestBoard.cs new file mode 100644 index 0000000..1cffe4c --- /dev/null +++ b/Qwirkle/TestBase/TestBoard.cs @@ -0,0 +1,38 @@ +using QwirkleClassLibrary; +namespace TestBase; + +public class TestBoard +{ + + + + public static IEnumerable Data_Board() + { + yield return new object[] + { + true, + new Cell(0,0), + new Tile(Shape.Round, Color.Red) + }; + yield return new object[] + { + false, + new Cell(0,0), + new Tile(Shape.Round, Color.Red) + }; + } + + [Theory] + [MemberData(nameof(Data_Board))] + public void Test_AddTile(bool except, Cell c, Tile t) + { + if (!except) + { + c.SetTile(t); + Assert.False(c.SetTile(t)); + return; + } + Assert.True(c.SetTile(t)); + } +} + diff --git a/Qwirkle/TestBase/TestScore.cs b/Qwirkle/TestBase/TestScore.cs index b001591..7f1fd02 100644 --- a/Qwirkle/TestBase/TestScore.cs +++ b/Qwirkle/TestBase/TestScore.cs @@ -3,29 +3,17 @@ namespace TestBase; public class TestScore { - public static IEnumerable Data_Score() - { - yield return new object[] - { - true, - new Player("Test"), - }; - yield return new object[] - { - false, - null, - }; - } - [Theory] - [MemberData(nameof(Data_Score))] - public void Test_CellScoreConstructor(bool except, Player p) + [InlineData(false)] + //[InlineData(true)] + public void Test_CellScoreConstructor(bool except) { - if (!except) + /*if (!except) { - Assert.Throws(() => new Score(p)); + Assert.Throws(() => new Score(null)); return; - } + }*/ + Player p = new Player("test"); Score score = new Score(p); Assert.True(true); }