コード例 #1
0
        public void If_Positive_Value_Less_Then_10_Should_Return_True()
        {
            // Arrange
            var solution = new PalindromeNumberSolution();

            //act
            var oneResult   = solution.IsPalindrome(1);
            var twoResult   = solution.IsPalindrome(2);
            var sevenResult = solution.IsPalindrome(7);
            var nineResult  = solution.IsPalindrome(9);

            //Assert
            Assert.True(oneResult);
            Assert.True(twoResult);
            Assert.True(sevenResult);
            Assert.True(nineResult);
        }
コード例 #2
0
        public void If_Negative_Value_Should_Return_False()
        {
            // Arrange
            var solution = new PalindromeNumberSolution();

            //act
            var result = solution.IsPalindrome(-11);

            //Assert
            Assert.False(result);
        }
コード例 #3
0
        public void Common_Case_Should_Be_True()
        {
            // Arrange
            var solution = new PalindromeNumberSolution();

            //act
            var result = solution.IsPalindrome(121);

            //Assert
            Assert.True(result);
        }
コード例 #4
0
        public void Odd_Palindrome_Number_Should_Return_True()
        {
            // Arrange
            var solution = new PalindromeNumberSolution();

            //act
            var result = solution.IsPalindrome(1212121);

            //Assert
            Assert.True(result);
        }
コード例 #5
0
        public void Max_Int_Should_Be_False()
        {
            // Arrange
            var solution = new PalindromeNumberSolution();

            //act
            var result = solution.IsPalindrome(int.MaxValue);

            //Assert
            Assert.False(result);
        }