Exemplo n.º 1
0
            public void GivenParticipantsLeftToActInCurrentPass_ThenReturnNextParticipant()
            {
                // arrange
                var bag        = new DiceBag();
                var characters = new List <ICharacter>();
                var actual     = new CombatTurnService <MockInitiativePass>(bag);

                actual.Setup(characters);
                (actual.CurrentInitiativePass as MockInitiativePass).IsComplete       = false;
                (actual.CurrentInitiativePass as MockInitiativePass).ShouldReturnNext = true;

                // act
                var results = actual.Next();

                // assert
                Assert.IsNotNull(results);
                Assert.IsFalse((actual.CurrentInitiativePass as MockInitiativePass).WasResetCalled);
                Assert.IsTrue((actual.CurrentInitiativePass as MockInitiativePass).WasNextCalled);
            }
Exemplo n.º 2
0
            public void GivenPassIsCompletedAndNoOneLeftToAct_ThenMarkCompletedAndReturnNull()
            {
                // arrange
                var bag        = new DiceBag();
                var characters = new List <ICharacter>();
                var actual     = new CombatTurnService <MockInitiativePass>(bag);

                actual.Setup(characters);
                (actual.CurrentInitiativePass as MockInitiativePass).IsComplete       = true;
                (actual.CurrentInitiativePass as MockInitiativePass).NeedsAnotherPass = false;

                // act
                var results = actual.Next();

                // assert
                Assert.IsNull(results);
                Assert.IsFalse((actual.CurrentInitiativePass as MockInitiativePass).WasResetCalled);
                Assert.IsFalse((actual.CurrentInitiativePass as MockInitiativePass).WasNextCalled);
            }