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