public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Get["/result"] = _ =>{ string playerOne = Game.RandomPlayer1(); string playerTwo = Request.Query["player2"]; Game myGame= new Game(playerOne,playerTwo); return View["result.cshtml",myGame]; }; }
public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Get["/result"] = _ =>{ string[] threeType=new string[]{"rock","scissor","paper"}; Random a = new Random(); string playerOne = threeType[a.Next(0,3)]; string playerTwo = threeType[a.Next(0,3)]; Game myGame= new Game(playerOne,playerTwo); return View["result.cshtml",myGame]; }; }
public void Test6_GameWinners_ScissorAndPaper_ScissorWins() { string[] tempResult= new string[]{"scissor Wins","player2 Wins"}; Game testGame = new Game("Paper", "Scissor"); Assert.Equal(tempResult, testGame.GameWinners()); }
public void Test4_GameWinners_RockAndPaper_PaperWins() { string[] tempResult= new string[]{"paper Wins","player1 Wins"}; Game testGame = new Game("Paper", "Rock"); Assert.Equal(tempResult, testGame.GameWinners()); }
public void Test3_GameWinners_RockAndScissor_RockWins() { string[] tempResult= new string[]{"rock Wins","player2 Wins"}; Game testGame = new Game("Scissor", "Rock"); Assert.Equal(tempResult, testGame.GameWinners()); }
public void Test1_GameWinners_RockAndRock_Draw() { string[] tempResult= new string[]{"Draw","No One Win"}; Game testGame = new Game("Rock", "Rock"); Assert.Equal(tempResult, testGame.GameWinners()); }