Esempio n. 1
0
 public void TestThatVectorsCanBeSummed()
 {
     var v1 = new Vector(1, 2);
     var v2 = new Vector(2, 4);
     var v3 = v1 + v2;
     Assert.AreEqual(3, v3.X);
     Assert.AreEqual(6, v3.Y);
 }
Esempio n. 2
0
 public GridPoint(Vector vector, Colour colour = Colour.None)
 {
     this.Vector = vector;
     this.Colour = colour;
     this.Above = vector + new Vector(0, 1);
     this.Below = vector + new Vector(0, -1);
     this.Left = vector + new Vector(-1, 0);
     this.Right = vector + new Vector(1, 0);
 }
Esempio n. 3
0
 public void TestThatVectorsWithDifferentXAndYAreNotEqual()
 {
     var v1 = new Vector(1, 2);
     var v2 = new Vector(2, 1);
     Assert.AreNotEqual(v1, v2);
 }
Esempio n. 4
0
 public void TestThatAVectorIsNotEqualToNull()
 {
     var v1 = new Vector(1, 2);
     Vector v2 = null;
     Assert.AreNotEqual(v1, v2);
 }
Esempio n. 5
0
 public void TestThatVectorsWithIdenticalXAndYAreEqual()
 {
     var v1 = new Vector(1, 2);
     var v2 = new Vector(1, 2);
     Assert.AreEqual(v1, v2);
 }