예제 #1
0
        public void ShouldInitializeOwlsAtStartingPositions()
        {
            var owls = new Parliament(2);

            owls.AssertPositionsMatch(0, 1);
            Assert.AreEqual(0, owls.InTheNest);
        }
예제 #2
0
        public void ShouldPerformMoveAction()
        {
            var owls = new Parliament(2);

            owls.Move(0, 2);

            owls.AssertPositionsMatch(1, 2);
            Assert.AreEqual(0, owls.InTheNest);
        }
예제 #3
0
        public void ShouldPerformNestAction()
        {
            var owls = new Parliament(2);

            owls.Nest(0);

            owls.AssertPositionsMatch(1);
            Assert.AreEqual(1, owls.InTheNest);
        }
예제 #4
0
        public void ShouldNotBeEqualIfTheyHaveDifferentOwlCounts()
        {
            var twoOwls   = new Parliament(2);
            var threeOwls = new Parliament(3);

            threeOwls.Nest(threeOwls.LeadOwl);

            twoOwls.AssertPositionsMatch(threeOwls);
            Assert.AreEqual(0, twoOwls.InTheNest);
            Assert.AreEqual(1, threeOwls.InTheNest);
            Assert.AreNotEqual(twoOwls, threeOwls);
        }
예제 #5
0
 public static void AssertPositionsMatch(this Parliament owls, Parliament otherOwls)
 {
     owls.AssertPositionsMatch(otherOwls.ListOfPositions.ToArray());
 }