public void Test3_IfInput1IsRockAndInput2IsPaper_ReturnPlayer2() { //Arrange string input1 = "rock"; string input2 = "paper"; Game testGame = new Game(input1, input2); //Act string result = testGame.GetResults(); //Assert Assert.Equal("Player 2", result); }
public void Test1_IfInput1EqualsInput2_ReturnTie() { //Arrange string input1 = "rock"; string input2 = "rock"; Game testGame = new Game(input1, input2); //Act string result = testGame.GetResults(); //Assert Assert.Equal("tie", result); }
public HomeModule() { Get["/"] = _ => { string result = ""; return View["index.cshtml", result]; }; Post["/"] = _ => { Game newGame = new Game(Request.Form["input1"], Request.Form["input2"]); string result = newGame.GetResults(); return View["index.cshtml", result]; }; }
public void Shoot_RockPaper_Winner() { Game newGame = new Game (); Assert.Equal("User2 wins", newGame.Shoot("rock","paper")); }
public void Shoot_SameInputs_Draw() { Game newGame = new Game (); Assert.Equal("This round was a draw", newGame.Shoot("rock","rock")); }
public void Shoot_RockScissors_Winner() { Game newGame = new Game (); Assert.Equal("User1 wins", newGame.Shoot("rock","scissors")); }