Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter a word or phrase to determine if it is a palindrome: ");
            string input = Console.ReadLine();

            PalIdentifier palindromeTest = new PalIdentifier(input);

            Console.WriteLine($"{palindromeTest.Word} is a palindrome: {palindromeTest.IsPalindrome().ToString().ToLower()}");
        }
        public void Test_Word()
        {
            PalIdentifier testPal  = new PalIdentifier("Racecar");
            PalIdentifier testPal2 = new PalIdentifier("never odd or even");
            PalIdentifier testPal3 = new PalIdentifier("breakfast");

            Assert.True(testPal.IsPalindrome());
            Assert.True(testPal2.IsPalindrome());
            Assert.False(testPal3.IsPalindrome());
        }