public void TestThatAGridPointWithAColourHasAStone() { var gp1 = new GridPoint(2, 3, Colour.Black); var gp2 = new GridPoint(4, 5, Colour.White); Assert.IsTrue(gp1.HasStone); Assert.IsTrue(gp2.HasStone); }
public void TestThatAGroupIsEqualToAnotherWithTheSameGridPoints() { var gp = new GridPoint(2, 2); var group1 = new Group(gp); var group2 = new Group(gp); Assert.AreEqual(group1, group2); }
public void TestAMoveEqualsAnotherIfTheyCaptureTheSameGridPointsAndTheirPositionsMatch() { var gp1 = new GridPoint(1, 1); var gp2 = new GridPoint(2, 2); var move1 = new Move(gp1, new Group(gp2)); var move2 = new Move(gp1, new Group(gp2)); Assert.AreEqual(move1, move2); }
public void TestAMoveDoesNotEqualAnotherIfTheyHaveDifferentCapturedGridPoints() { var gp1 = new GridPoint(1, 1); var gp2 = new GridPoint(2, 2); var gp3 = new GridPoint(3, 3); var move1 = new Move(gp1, new Group(gp2)); var move2 = new Move(gp1, new Group(gp3)); Assert.AreNotEqual(move1, move2); }
public void TestExceptGroupsFindsUniqueElementsInAGroup() { var gp1 = new GridPoint(1, 1); var gp2 = new GridPoint(2, 2); var gp3 = new GridPoint(3, 3); var group1 = new Group(gp1, gp2, gp3); var group2 = new Group(gp2); var group3 = new Group(gp3); var newGroup = group1.ExceptGroups(group2, group3); Assert.AreEqual(1, newGroup.Count); Assert.IsTrue(newGroup.Contains(gp1)); }
public void TestThatOneGridPointEqualsAnother() { var gp1 = new GridPoint(4, 5); var gp2 = new GridPoint(4, 5); Assert.AreEqual(gp1, gp2); }
public void TestThatAGridPointHasAVectorLeftOfIt() { var gp = new GridPoint(4, 5); Assert.AreEqual(new Vector(3, 5), gp.Left); }
public void TestThatAGridPointHasAVectorRightOfIt() { var gp = new GridPoint(4, 5); Assert.AreEqual(new Vector(5, 5), gp.Right); }
public void TestThatAGridPointHasAVectorBelowIt() { var gp = new GridPoint(4, 5); Assert.AreEqual(new Vector(4, 4), gp.Below); }
public void TestThatAGridPointHasAVectorAboveIt() { var gp = new GridPoint(4, 5); Assert.AreEqual(new Vector(4, 6), gp.Above); }
public void TestThatAGridPointWithoutAColourHasNoStone() { var gp = new GridPoint(4, 5); Assert.IsFalse(gp.HasStone); }
public Move(GridPoint gridPoint, Group capturedStones) : base(gridPoint.Vector, gridPoint.Colour) { this.CapturedStones = capturedStones; }