Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
 public void When_PalindromTesterIsInstanciatedWithPalindrome_SHouldReturnTrue()
 {
     Assert.AreEqual(palindromThatPasses.IsItPalindrome(), true);
 }
Ejemplo n.º 3
0
 public void When_PalindromTesterIsInstanciatedWithNonPalindrome_SHouldReturnFalse()
 {
     Assert.AreEqual(palindromThatFails.IsItPalindrome(), false);
 }