public void ShouldPerformNestAction() { var owls = new Parliament(2); owls.Nest(0); owls.AssertPositionsMatch(1); Assert.AreEqual(1, owls.InTheNest); }
public void ShouldThrowWhenReferencingNonowl() { var owls = new Parliament(2); Assert.ThrowsException <InvalidMoveException>(() => { owls.Move(2, 10); }); Assert.ThrowsException <InvalidMoveException>(() => { owls.Nest(2); }); }
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); }
public void ShouldBeEqualIfTheyRepresentTheSameState() { var someOwls = new Parliament(2); var identicalOwls = new Parliament(2); someOwls.Nest(someOwls.TrailingOwl); someOwls.Move(someOwls.LeadOwl, 20); // The same actions in the other order should be equivalent. identicalOwls.Move(identicalOwls.LeadOwl, 20); identicalOwls.Nest(identicalOwls.TrailingOwl); Assert.AreEqual(someOwls, identicalOwls); }