Exemplo n.º 1
0
        public void Generate_PingPongOutput_true()
        {
            //Arrange
            int    userInput  = 15;
            string testOutput = "PingPong";
            //Act
            List <string> output = PingPongGenerator.Generate(userInput);

            //Assert
            Assert.Equal(true, testOutput == output[14]);
        }
Exemplo n.º 2
0
 public HomeModule()
 {
     Get["/"] = _ => {
         List <string> model = new List <string> {
         };
         return(View["pingpong.cshtml", model]);
     };
     Post["/"] = _ => {
         List <string> newList = PingPongGenerator.Generate(int.Parse(Request.Form["input-num"]));
         return(View["pingpong.cshtml", newList]);
     };
 }
Exemplo n.º 3
0
        public void Generate_CountsUpToUserInput_ReturnsListOfInts()
        {
            //Arrange
            int           userInput  = 3;
            List <string> testOutput = new List <string> {
                "1", "2", "Ping"
            };
            //Act
            List <string> output = PingPongGenerator.Generate(userInput);

            //Assert
            Assert.Equal(testOutput, output);
        }