Exemplo n.º 1
0
        public HomeModule()
        {
            Get["/"] = _ => {
            return View["index.cshtml"];
              };

              Post["/number_added"] = _ => {
            Ping newPing = new Ping(Request.Form[int.Parse("number")]);

            newPing.Calculate();
            newPing.Save();
            List<Ping> allPings = Ping.GetAll();

            return View["/number_added.cshtml", allPings];
              };
        }
Exemplo n.º 2
0
 public void Calculate_ReturnPongForFive_true()
 {
     Ping testPing = new Ping(5);
       Assert.Equal("pong", testPing.Calculate());
 }
Exemplo n.º 3
0
 public void Calculate_ReturnPingPongForFifteen_true()
 {
     Ping testPing = new Ping(15);
       Assert.Equal("ping-pong", testPing.Calculate());
 }
Exemplo n.º 4
0
 public void Calculate_ReturnPingForThree_true()
 {
     Ping testPing = new Ping(3);
       Assert.Equal("ping", testPing.Calculate());
 }