public void Test1()
        {
            Palindrom objPalindrom = new Palindrom();

            //Act
            bool result = objPalindrom.IsPalindrom("redivider");

            //Assert
            Assert.IsType <bool>(result);
            Assert.True(result);

            bool resultNegative = objPalindrom.IsPalindrom("Test");

            Assert.False(resultNegative);
        }
Beispiel #2
0
        public void IsPalindrom_inputNotPalindromMultipleWords_ReturnsFalse()
        {
            //Arrange
            var palindrom = new Palindrom("Ala ma kota");
            //Act
            var result = palindrom.IsPalindrom();

            //Assert
            Assert.IsFalse(result);
        }
Beispiel #3
0
        public void IsPalindrom_inputPalindromOneWord_ReturnsTrue()
        {
            //Arrange
            var palindrom = new Palindrom("kajak");
            //Act
            var result = palindrom.IsPalindrom();

            //Assert
            Assert.IsTrue(result);
        }
Beispiel #4
0
        public void IsPalindrom_inputPalindromMultipleWords_ReturnsTrue()
        {
            //Arrange
            var palindrom = new Palindrom("koby³a ma ma³y bok");
            //Act
            var result = palindrom.IsPalindrom();

            //Assert
            Assert.IsTrue(result);
        }
Beispiel #5
0
        public void IsPalindromThrow()
        {
            //Arrange
            long ib = 1000000000000001;;
            bool isit;
            bool exceptionThrown = true;

            //Act
            try
            {
                isit = Palindrom.IsPalindrom(ib);
                Console.WriteLine("it is palindrome");
            }
            catch (InvalidOperationException)
            {
                exceptionThrown = true;
            }
            //Assert
            Assert.IsTrue(exceptionThrown);
        }