public void GivenNoOneWhoHasNotActedAlsoHasPositiveInitiative_ThenReturnNull() { // arrange var actual = new InitiativePass_MainActionsCostInitiativeImmediately(); actual.Setup(new DiceBag(), new List <Character>()); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 0, HasActed = false }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 15, HasActed = true }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 17, HasActed = true }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 0, HasActed = false }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 8, HasActed = true }); // act var results = actual.Next(); // assert Assert.IsNull(results); }
public void GivenThereIsSomeoneLeftToAct_ThenReturnTheNextCharacterAndSubtractInitiative() { // arrange var actual = new InitiativePass_MainActionsCostInitiativeImmediately(); var three = new InitiativePassSlot() { CurrentInitiative = 17, HasActed = false }; actual.Setup(new DiceBag(), new List <Character>()); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 0, HasActed = false }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 15, HasActed = false }); actual.InitiativeOrder.Add(three); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 0, HasActed = false }); actual.InitiativeOrder.Add(new InitiativePassSlot() { CurrentInitiative = 8, HasActed = false }); // act var results = actual.Next(); // assert Assert.IsNotNull(results); Assert.AreSame(three, results); Assert.AreEqual(7, three.CurrentInitiative); }