protected void CheckIfPalindrome(object sender, EventArgs e) { if (IsValid) { PalindromTester tester = new PalindromTester(this.txtWord.Text); var isIt = tester.IsItPalindrome(); this.lblResult.Visible = true; switch (isIt) { case true: this.lblResult.ForeColor = System.Drawing.Color.Green; this.lblResult.Text = "The word is palindrome."; break; case false: this.lblResult.ForeColor = System.Drawing.Color.Red; this.lblResult.Text = "The word is not palindrome."; break; default: break; } } }
public void When_PalindromTesterIsInstanciatedWithPalindrome_SHouldReturnTrue() { Assert.AreEqual(palindromThatPasses.IsItPalindrome(), true); }
public void When_PalindromTesterIsInstanciatedWithNonPalindrome_SHouldReturnFalse() { Assert.AreEqual(palindromThatFails.IsItPalindrome(), false); }