diff --git a/Sources/Tests/Data_UTs/Dice/DiceGroupManagerTest.cs b/Sources/Tests/Data_UTs/Dice/DiceGroupManagerTest.cs index a64a9dc..435f53b 100644 --- a/Sources/Tests/Data_UTs/Dice/DiceGroupManagerTest.cs +++ b/Sources/Tests/Data_UTs/Dice/DiceGroupManagerTest.cs @@ -71,5 +71,34 @@ namespace Tests.Data_UTs.Dice } + [Fact] + public void TestAddIfNullThrowsException() + { + DiceGroupManager dgm = new(); + + KeyValuePair> group1 = stubGameRunner.DiceGroupManager.GetAll().First(); + KeyValuePair> group2 = stubGameRunner.DiceGroupManager.GetAll().Last(); + NumberFace[] d6Faces = new NumberFace[] { new(1), new(2), new(3), new(4), new(5), new(6) }; + + + Dictionary> expected = new() + { + { "", new List{ new NumberDie(d6Faces[0], d6Faces[1..]), new NumberDie(d6Faces[0], d6Faces[3..]) } } + }; + + void action() => expected = new() + { + { "", new List{ new NumberDie(d6Faces[0], d6Faces[1..]), new NumberDie(d6Faces[0], d6Faces[3..]) } } + }; + // Xunit.Assert.Empty(expected.Keys); + foreach (KeyValuePair> entry in expected) + { + Xunit.Assert.Empty(entry.Key); + // do something with entry.Value or entry.Key + } + + } + + } }