예제 #1
0
            public void GivenEveryoneActed_ThenReturnNull()
            {
                // arrange
                var actual = new InitiativePass();

                actual.Setup(new DiceBag(), new List <Character>());
                actual.InitiativeOrder.Add(new InitiativePassSlot()
                {
                    CurrentInitiative = 5, HasActed = true
                });
                actual.InitiativeOrder.Add(new InitiativePassSlot()
                {
                    CurrentInitiative = 15, HasActed = true
                });
                actual.InitiativeOrder.Add(new InitiativePassSlot()
                {
                    CurrentInitiative = 17, HasActed = true
                });
                actual.InitiativeOrder.Add(new InitiativePassSlot()
                {
                    CurrentInitiative = 10, HasActed = true
                });
                actual.InitiativeOrder.Add(new InitiativePassSlot()
                {
                    CurrentInitiative = 8, HasActed = true
                });

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

                // assert
                Assert.IsNull(results);
            }
예제 #2
0
            public void GivenNoOneWhoHasNotActedAlsoHasPositiveInitiative_ThenReturnNull()
            {
                // arrange
                var actual = new InitiativePass();

                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);
            }
예제 #3
0
            public void GivenThereIsSomeoneLeftToAct_ThenReturnTheNextCharacter()
            {
                // arrange
                var actual = new InitiativePass();
                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);
            }