Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public void TestThatAGroupIsEqualToAnotherWithTheSameGridPoints()
 {
     var gp = new GridPoint(2, 2);
     var group1 = new Group(gp);
     var group2 = new Group(gp);
     Assert.AreEqual(group1, group2);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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));
 }
Exemplo n.º 6
0
 public void TestThatOneGridPointEqualsAnother()
 {
     var gp1 = new GridPoint(4, 5);
     var gp2 = new GridPoint(4, 5);
     Assert.AreEqual(gp1, gp2);
 }
Exemplo n.º 7
0
 public void TestThatAGridPointHasAVectorLeftOfIt()
 {
     var gp = new GridPoint(4, 5);
     Assert.AreEqual(new Vector(3, 5), gp.Left);
 }
Exemplo n.º 8
0
 public void TestThatAGridPointHasAVectorRightOfIt()
 {
     var gp = new GridPoint(4, 5);
     Assert.AreEqual(new Vector(5, 5), gp.Right);
 }
Exemplo n.º 9
0
 public void TestThatAGridPointHasAVectorBelowIt()
 {
     var gp = new GridPoint(4, 5);
     Assert.AreEqual(new Vector(4, 4), gp.Below);
 }
Exemplo n.º 10
0
 public void TestThatAGridPointHasAVectorAboveIt()
 {
     var gp = new GridPoint(4, 5);
     Assert.AreEqual(new Vector(4, 6), gp.Above);
 }
Exemplo n.º 11
0
 public void TestThatAGridPointWithoutAColourHasNoStone()
 {
     var gp = new GridPoint(4, 5);
     Assert.IsFalse(gp.HasStone);
 }
Exemplo n.º 12
0
 public Move(GridPoint gridPoint, Group capturedStones) : base(gridPoint.Vector, gridPoint.Colour)
 {
     this.CapturedStones = capturedStones;
 }