예제 #1
0
 public void TestMethodIfDiagonal()
 {
     CastelMove.Position destination = new CastelMove.Position();
     this.current.X = 5;
     this.current.Y = 0;
     for (int i = 1; i < 3; i++)
     {
         destination.X = this.current.X - i;
         destination.Y = this.current.Y + i;
         Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), false);
     }
 }
예제 #2
0
 public void TestMethodIfHorizontalNotWork2()
 {
     this.current.Y = 0;
     this.current.X = 0;
     CastelMove.Position destination = new CastelMove.Position();
     destination.X = 0;
     for (int i = 2; i < 5; i++)
     {
         destination.Y = i;
         Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), false);
     }
 }
예제 #3
0
 public void TestMethodIfOutofBounds()
 {
     CastelMove.Position destination = new CastelMove.Position();
     destination.X  = 100;
     destination.Y  = 100;
     this.current.X = 0;
     this.current.Y = 0;
     Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), false);
     this.current.X = 100;
     this.current.Y = 100;
     destination.X  = 0;
     destination.Y  = 0;
     Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), false);
 }
예제 #4
0
        public void TestMethodIfVerticalWork2()
        {
            this.current.X = 6;
            this.current.Y = 0;
            CastelMove.Position destination = new CastelMove.Position();
            destination.X = 1;
            for (int i = 0; i < 5; i++)
            {
                destination.Y  = i;
                this.current.Y = i;
                Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), true);
            }

            this.current.X = 0;
            for (int i = 1; i < 5; i++)
            {
                destination.Y  = i;
                this.current.Y = i;
                Assert.AreEqual(CastelMove.Program.VerifyCastelMovement(this.board, this.current, destination), true);
            }
        }