public ActionResult DisplayResult() { PingPong newPingPong = new PingPong(); List <string> allNumbers = newPingPong.GetResult(int.Parse(Request.Form["inputNumber"])); return(View(allNumbers)); }
public void GetResult_NumberNotAMultipleOfAbove_2() { PingPong testPingPong = new PingPong(); List <string> result = testPingPong.GetResult(2); Assert.AreEqual("2", result[1]); }
public void GetResult_NumberMultipleOfThree_ping() { PingPong testPingPong = new PingPong(); List <string> result = testPingPong.GetResult(3); Assert.AreEqual("ping", result[2]); }
public void GetResult_NumberMultipleOfFive_pong() { PingPong testPingPong = new PingPong(); List <string> result = testPingPong.GetResult(5); Assert.AreEqual("pong", result[4]); }
public void GetResult_NumberMultipleOfFifteen_pingpong() { PingPong testPingPong = new PingPong(); List <string> result = testPingPong.GetResult(15); Assert.AreEqual("PingPong", result[14]); }
public void GetResult_ListofFifteen_pingpong() { PingPong testPingPong = new PingPong(); List <string> expected = new List <string> { "1", "2", "Ping", "4", "Pong", "Ping", "7", "8", "Ping", "Pong", "11", "Ping", "13", "14", "PingPong" }; List <string> result = testPingPong.GetResult(15); foreach (string item in result) { Console.WriteLine("Output: " + item); } CollectionAssert.AreEqual(expected, result); }