コード例 #1
0
            public void GivenOtherIsNull_ThrowArgumentNullException()
            {
                // arrange
                var actual = new InitiativePassSlot();

                // act
                var results = actual.CompareTo(null);

                // assert
                Assert.Fail("ArgumentNullException should have been thrown");
            }
コード例 #2
0
            public void GivenBothHaveNotActedAndBothHaveSameInitiative_ThenEqual()
            {
                // arrange
                var other = new InitiativePassSlot()
                {
                    HasActed = false, CurrentInitiative = 5
                };
                var actual = new InitiativePassSlot()
                {
                    HasActed = false, CurrentInitiative = 5
                };

                // act
                var results = actual.CompareTo(other);

                // assert
                Assert.AreEqual(0, results);
            }
コード例 #3
0
            public void GivenBothHaveNotActedAndOtherHasAHigherInitiative_ThenOtherPrecedesThis()
            {
                // arrange
                var other = new InitiativePassSlot()
                {
                    HasActed = false, CurrentInitiative = 8
                };
                var actual = new InitiativePassSlot()
                {
                    HasActed = false, CurrentInitiative = 3
                };

                // act
                var results = actual.CompareTo(other);

                // assert
                Assert.AreEqual(1, results);
            }
コード例 #4
0
            public void GivenThisHasNotActedAndOtherHas_ThenThisPrecedesOther()
            {
                // arrange
                var other = new InitiativePassSlot()
                {
                    HasActed = true
                };
                var actual = new InitiativePassSlot()
                {
                    HasActed = false
                };

                // act
                var results = actual.CompareTo(other);

                // assert
                Assert.AreEqual(-1, results);
            }