Пример #1
0
        public void Create_DuplicateRollsAreIgnored_ReturnsPlayersInDescendingOrder(UInt32 firstRoll, UInt32 secondRoll, UInt32 thirdRoll, UInt32 fourthRoll, Int32 first, Int32 second, Int32 third)
        {
            var players = new Player[] { new Player(), new Player(), new Player() };

            var mockDice = new MockDiceCreator()
                           .AddExplicitDiceRollSequence(new uint[] { firstRoll, secondRoll, thirdRoll, fourthRoll })
                           .Create();

            var setupOrder = PlayerTurnOrderCreator.Create(players, mockDice);

            setupOrder.ShouldBe(new IPlayer[] { players[first], players[second], players[third] });
        }
Пример #2
0
        public void Create_DifferentRolls_ReturnsPlayersInDescendingOrder(UInt32 firstRoll, UInt32 secondRoll, UInt32 thirdRoll, UInt32 fourthRoll, Int32 first, Int32 second, Int32 third, Int32 fourth)
        {
            var player1 = new Player();
            var player2 = new Player();
            var player3 = new Player();
            var player4 = new Player();

            var players  = new IPlayer[] { player1, player2, player3, player4 };
            var mockDice = new MockDiceCreator()
                           .AddExplicitDiceRollSequence(new uint[] { firstRoll, secondRoll, thirdRoll, fourthRoll })
                           .Create();
            var setupOrder = PlayerTurnOrderCreator.Create(players, mockDice);

            setupOrder.ShouldBe(new IPlayer[] { players[first], players[second], players[third], players[fourth] });
        }