public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Post["/"] = _ => { var newQueen = new Queen(Request.Form["x1"], Request.Form["y1"]); return View["index.cshtml",newQueen.CanAttack(Request.Form["x2"],Request.Form["y2"])]; }; }
public void TestIfQueenCanAttackDiag() { //Arrange int userOneX = 3; int userOneY = 2; //Act var newQueen = new Queen(userOneX, userOneY); //Assert Assert.Equal(true, newQueen.CanAttack(6, 5)); }
public void TestIfQueenCanAttackRows() { //Arrange int userOneX = 3; int userOneY = 6; //Act var newQueen = new Queen(userOneX, userOneY); //Assert Assert.Equal(true, newQueen.CanAttack(4, 6)); }
public void Queen_ForVertical_true() { Queen queen = new Queen(2, 4); Assert.Equal(true, queen.CanAttack(3, 4)); }
public void Queen_ForVertical_false() { Queen queen = new Queen(3, 2); Assert.Equal(false, queen.CanAttack(2, 4)); }
public void Queen_ForHorizontal_true() { Queen queen = new Queen(2, 2); Assert.Equal(true, queen.CanAttack(2, 4)); }
public void Queen_ForDiagonal_true() { Queen queen = new Queen(5, 5); Assert.Equal(true, queen.CanAttack(6, 6)); }
public void Queen_ForDiagonal_false() { Queen queen = new Queen(5, 5); Assert.Equal(false, queen.CanAttack(3, 8)); }
public void Attack_QueenAttacksVertically_true() { Queen testCoordinates = new Queen() {}; Assert.Equal(true, testCoordinates.IsAttack(1,5,1,4)); }
public void Attack_QueenAttacksHorizontally_true() { Queen testCoordinates = new Queen() {}; Assert.Equal(true, testCoordinates.IsAttack(5, 1, 4, 1)); }
public void Attack_QueenAttacksDiagonally_true() { Queen testCoordinates = new Queen() {}; Assert.Equal(true, testCoordinates.IsAttack(4, 1 , 4, 2)); }