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