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 TestIfQueenCanAttackHorizontal_1151_true() { Queen newQueen = new Queen(1,1); Assert.Equal(newQueen.AttackHorizontal(5,1), true); }
public void TestIfQueenCanAttackHorizontal_1123_false() { Queen newQueen = new Queen(1,1); Assert.Equal(newQueen.AttackHorizontal(2,3), false); }