예제 #1
0
        public void Clone_SingleHand_CollectedDiceAreEqual(int[] toCollect)
        {
            var collectedDice = new CollectedDice();

            collectedDice.Collect(toCollect);

            var clone = (CollectedDice)collectedDice.Clone();

            CollectionAssert.AreEqual(collectedDice.AllCollectedDice, clone?.AllCollectedDice);
        }
예제 #2
0
        public void Clone_MultipleHands_CollectedDiceAreEqual(int[] firstCollect, int[] thenCollect)
        {
            var collectedDice = new CollectedDice();

            collectedDice.Collect(firstCollect);
            collectedDice.Collect(thenCollect);

            var clone = (CollectedDice)collectedDice.Clone();

            CollectionAssert.AreEqual(collectedDice.AllCollectedDice, clone.AllCollectedDice);
        }
예제 #3
0
        public void Collect_CheckPropertiesLastCollectedAndAllCollectedDice(int[] toCollect, int[] toExpectedDiceCollections)
        {
            var collectedDice           = new CollectedDice();
            var expectedDiceCollections = ListToDiceCollection(toExpectedDiceCollections);

            collectedDice.Collect(toCollect);

            // Checks for last collected.
            collectedDice.ShouldSatisfyAllConditions(
                () => collectedDice.LastCollected.ShouldNotBeNull(),
                () => collectedDice.LastCollected.ShouldBe(expectedDiceCollections.Last())
                );

            // Check for all collected dice.
            CollectionAssert.AreEqual(expectedDiceCollections, collectedDice.AllCollectedDice);
        }
예제 #4
0
        public void Collect_CollectTwoHands_CorrectlyAddsToLastCollected(int[] firstCollect, int[] thenCollect, int[] toExpectedDiceCollections)
        {
            var collectedDice           = new CollectedDice();
            var expectedDiceCollections = ListToDiceCollection(toExpectedDiceCollections);

            collectedDice.Collect(firstCollect);
            collectedDice.Collect(thenCollect);

            // Checks for last collected.
            collectedDice.ShouldSatisfyAllConditions(
                () => collectedDice.LastCollected.ShouldNotBeNull(),
                () => collectedDice.LastCollected.ShouldBe(expectedDiceCollections.Last())
                );

            // Check for all collected dice.
            CollectionAssert.AreEqual(expectedDiceCollections, collectedDice.AllCollectedDice);
        }