isPalindrome() static private method

static private isPalindrome ( Match, word ) : bool
word Match,
return bool
        static void Main(string[] args)
        {
            Palindrome Palindrome = new Palindrome("never Odd, or Even.");

            Console.WriteLine(Palindrome.isPalindrome());
            Console.ReadKey();
        }
Example #2
0
        public void isPalindromeTest()
        {
            String s = "";

            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "A";
            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "Aa";
            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "At";
            Assert.IsFalse(Palindrome.isPalindrome(s));

            s = "Tat";
            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "Tan";
            Assert.IsFalse(Palindrome.isPalindrome(s));

            s = "toot";
            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "loot";
            Assert.IsFalse(Palindrome.isPalindrome(s));

            s = "Radar";
            Assert.IsTrue(Palindrome.isPalindrome(s));

            s = "hello";
            Assert.IsFalse(Palindrome.isPalindrome(s));
        }
        public void TestMethod1()
        {
            bool a1 = Palindrome.isPalindrome(word1);

            //Assert a;
            Assert.AreEqual(true, a1);
        }
Example #4
0
        public void isPalindromeTest()
        {
            string     expected   = "abba";
            Palindrome palindrome = new Palindrome();
            string     actual     = palindrome.isPalindrome(expected);

            Assert.AreEqual(expected, actual);
        }
        public void isPaladroneabcTestMethod1()
        {
            Palindrome paladrone = new Palindrome("abc");
            bool       expected  = false;
            bool       actual    = paladrone.isPalindrome();

            Assert.AreEqual(expected, actual);
        }
        public void isPaladroneEvenOddTestMethod1()
        {
            Palindrome paladrone = new Palindrome("never Odd, or Even.");
            bool       expected  = true;
            bool       actual    = paladrone.isPalindrome();

            Assert.AreEqual(expected, actual);
        }
        public void isPaladrone1221TestMethod1()
        {
            Palindrome paladrone = new Palindrome("1221");
            bool       expected  = true;
            bool       actual    = paladrone.isPalindrome();

            Assert.AreEqual(expected, actual);
        }
Example #8
0
    public static void Main()
    {
        // Console.WriteLine("Enter a word to find out if it's a palindrome");
        // string stringWord = Console.ReadLine();
        // // char[] arrayWord = stringWord.ToCharArray();
        // // string[] splitWord = arrayWord.Split();
        // // string[] word = stringWord;
        //
        // Console.WriteLine(Palindrome.ReverseString(stringWord));
        Console.WriteLine("Enter something:");
        string response = Console.ReadLine();

        Palindrome pal    = new Palindrome(response);
        bool       result = pal.isPalindrome();

        Console.WriteLine("This is a palindrome: " + result);
    }
 public void TestMethod3()
 {
     Assert.IsTrue(Palindrome.isPalindrome(word3));
 }
Example #10
0
 public void Test1()
 {
     Assert.IsTrue(palindrome.isPalindrome("LEVEL"));
 }