public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Post["/output"] = _ => { var newQueen = new Queen(Request.Form["queen-x"], Request.Form["queen-y"]); var output = ( newQueen.AttackHorizontal(Request.Form["opp-x"], Request.Form["opp-y"]) || newQueen.AttackVertical(Request.Form["opp-x"], Request.Form["opp-y"]) || newQueen.AttackDiagonal(Request.Form["opp-x"], Request.Form["opp-y"]) ); return View["output.cshtml", output]; }; }
public void TestIfQueenCanAttackDiagonal_1133_true() { Queen newQueen = new Queen(1,1); Assert.Equal(newQueen.AttackDiagonal(3,3), true); }
public void TestIfQueenCanAttackDiagonal_1123_false() { Queen newQueen = new Queen(2,2); Assert.Equal(newQueen.AttackDiagonal(4,5), false); }