示例#1
0
        public HomeModule()
        {
            Get["/"] = _ =>
               {
             return View["gamepage.cshtml"];
               };
               Post ["/results"] =_=>
               {
            //  string input1 = Request.Form["P1supa"];
            //  string input2 = Request.Form["P2supa"];

             RPS newRPS = new RPS(Request.Form["player1"], Request.Form["player2"]);

             return View["results.cshtml",  newRPS.GetResult()];
               };
        }
示例#2
0
 public void Test3_CheckDraw_Draw()
 {
     RPS newRPS = new RPS(1,1);
     Assert.Equal("Draw", newRPS.GetResult());
 }
示例#3
0
 public void Test2_CheckLoss_Player1Win()
 {
     RPS newRPS = new RPS(0,2);
     Assert.Equal("Player 1 wins", newRPS.GetResult());
 }
示例#4
0
 public void Test1_CheckWin_Player2Win()
 {
     RPS newRPS = new RPS(2,0);
     Assert.Equal("Player 2 wins", newRPS.GetResult());
 }