Esempio n. 1
0
 public HomeModule()
 {
     Get["/"] = _ => View["index.cshtml"];
       Post["/palindrome_result"] = _ => {
     Input newInput = new Input ();
     string IsIt="";
     if (!newInput.IsPalindrome(Request.Form["input"]))
     {
       IsIt="not ";
     }
     return View["index.cshtml", "Your word/number is "+IsIt+"a palindrome"];
       };
 }
 public void IsPalindrome_Palindrome_True()
 {
     Input newInput = new Input ();
       Assert.Equal(true, newInput.IsPalindrome("radar"));
 }
 public void IsPalindrome_IgnoreSpaces_True()
 {
     Input newInput = new Input ();
       Assert.Equal(true, newInput.IsPalindrome("taco cat"));
 }
 public void IsPalindrome_NotPalindrome_False()
 {
     Input newInput = new Input ();
       Assert.Equal(false, newInput.IsPalindrome("charlie"));
 }