Ejemplo n.º 1
0
 public HomeModule()
 {
     Get["/"] = _ => {
       return View["index.cshtml"];
       };
       Post["/"] = _ => {
     PingPongGame.ClearAll();
     PingPongGame pingPongGame = new PingPongGame(int.Parse(Request.Form["userInput"]));
     List<string> userList = pingPongGame.GetAll();
     return View["index.cshtml", userList];
       };
 }
Ejemplo n.º 2
0
        public void Test1ReturnAListOfPingsAndPongs()
        {
            //Arrange
              int userInt = 7;
              PingPongGame pingPongGame = new PingPongGame(userInt);
              List<string> userList = pingPongGame.GetAll();

              //Act
              List<string> testList = new List<string>{"1", "2", "ping", "4", "pong", "ping", "7"};

              //Assert
              Assert.Equal(testList, userList);
        }