コード例 #1
0
        public void ShouldReverseList()
        {
            var  a       = PalindromSolverReverse.FromString("ABC");
            Node reverse = a.Reverse();

            Assert.Equal("CBA", reverse.ToString());
        }
コード例 #2
0
        public void ShouldCheckMatchesEmpty()
        {
            PalindromSolverReverse a = PalindromSolverReverse.FromString("");
            PalindromSolverReverse b = PalindromSolverReverse.FromString("");

            Assert.True(a.Matches(b));
        }
コード例 #3
0
        public void ShouldCheckNotMatchesSameSize()
        {
            PalindromSolverReverse a = PalindromSolverReverse.FromString("ABC");
            PalindromSolverReverse b = PalindromSolverReverse.FromString("ABZ");

            Assert.False(a.Matches(b));
        }
コード例 #4
0
        public void ShouldCheckTwoCharsNotPalindromString()
        {
            var a = PalindromSolverReverse.FromString("AB");

            Assert.False(a.IsPalindrom());
        }
コード例 #5
0
        public void ShouldCheckTwoCharsPalindromString()
        {
            var a = PalindromSolverReverse.FromString("AA");

            Assert.True(a.IsPalindrom());
        }
コード例 #6
0
        public void ShouldParsePalindrom()
        {
            PalindromSolverReverse palindrom = PalindromSolverReverse.FromString("ABA");

            Assert.Equal("ABA", palindrom.ToString());
        }
コード例 #7
0
        public void ShouldCheckEmptyString()
        {
            var a = PalindromSolverReverse.FromString("");

            Assert.True(a.IsPalindrom());
        }
コード例 #8
0
        public void ShouldCheckSmallPalindrom()
        {
            var a = PalindromSolverReverse.FromString("ABA");

            Assert.True(a.IsPalindrom());
        }