Exemplo n.º 1
0
        public void TestValidPalindrome()
        {
            ValidPalindrome palindrome = new ValidPalindrome();

            Assert.True(palindrome.IsPalindromeInPlace("A man, a plan, a canal: Panama"));
            Assert.True(palindrome.IsPalindrome("neen"));
            Assert.True(palindrome.IsPalindrome("kemek"));
            Assert.False(palindrome.IsPalindrome("race a car"));
        }
        public void ValidPalindromeTest(string s, bool expected)
        {
            var validPalindrome = new ValidPalindrome();

            var actual = validPalindrome.IsPalindrome(s);

            Assert.That(actual, Is.EqualTo(expected));
        }
 public void validPalindromeTest()
 {
     foreach (ValidPalindromeTestData testData in TestDataList)
     {
         Console.WriteLine("Input String:" + testData.InputString);
         var result = ValidPalindrome.IsPalindrome(testData.InputString);
         Console.WriteLine("Result: " + result);
         Assert.AreEqual(testData.OutputBool, result,
                         "Failed on the case: " + testData.InputString);
     }
 }
Exemplo n.º 4
0
        public void MaximumProductTest()
        {
            //VERIFY: check best solution
            //ASCII 48-57 (0-9)
            // A-Z (65-90)
            // a-z (97-122)
            var s = "A man, a plan, a canal: Panama";

            Assert.IsTrue(ValidPalindrome.IsPalindrome(s));//t

            s = "race a car";
            Assert.IsFalse(ValidPalindrome.IsPalindrome(s));//t
        }
Exemplo n.º 5
0
        public bool IsPalindrome(string s)
        {
            var valid = new ValidPalindrome(s);

            return(valid.IsPalindrome());
        }
Exemplo n.º 6
0
        void InternalTest(string word, bool expected)
        {
            bool actual = ValidPalindrome.IsPalindrome(word);

            Assert.Equal <bool>(expected, actual);
        }
        public void IsPalindromeTest(string v1, bool v2)
        {
            ValidPalindrome test = new ValidPalindrome();

            Assert.AreEqual(test.IsPalindrome(v1), v2);
        }