public void TestHorseIfWork() { current.X = 4; current.Y = 3; CastelMove_V2_.Position destination = new CastelMove_V2_.Position(); destination.X = current.X + 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X + 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X - 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X - 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X - 2; destination.Y = current.Y - 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X - 2; destination.Y = current.Y + 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); current.X = 3; destination.X = current.X + 2; destination.Y = current.Y + 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); destination.X = current.X + 2; destination.Y = current.Y - 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board, current, destination), true); }
public void IfDestinationIsAllie() { current.X = 4; current.Y = 3; CastelMove_V2_.Position destination = new CastelMove_V2_.Position(); destination.X = current.X + 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X + 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X - 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X - 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X - 2; destination.Y = current.Y - 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X - 2; destination.Y = current.Y + 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); current.X = 3; destination.X = current.X + 2; destination.Y = current.Y + 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); destination.X = current.X + 2; destination.Y = current.Y - 1; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board3, current, destination), false); }
public void TestIfBlocked() { current.X = 3; current.Y = 3; CastelMove_V2_.Position destination = new CastelMove_V2_.Position(); destination.X = current.X - 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board2, current, destination), false); destination.X = current.X - 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board2, current, destination), false); destination.X = current.X + 1; destination.Y = current.Y - 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board2, current, destination), false); destination.X = current.X + 1; destination.Y = current.Y + 2; Assert.AreEqual(CastelMove_V2_.Program.HorseMove(this.board2, current, destination), false); }