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); }
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); }