Example #1
0
        public void CompareTo_GivenSameLengthString_ReturnsZero()
        {
            // arrange
            var substring = new Palindrome()
            {
                Text = "equal."
            };
            var other = new Palindrome()
            {
                Text = "length"
            };

            // act
            int actual = substring.CompareTo(other);

            // assert
            Assert.Equal(0, actual);
        }
Example #2
0
        public void CompareTo_GivenLongerString_ReturnsNegativeValue()
        {
            // arrange
            var substring = new Palindrome()
            {
                Text = "substring"
            };
            var other = new Palindrome()
            {
                Text = "other"
            };

            // act
            int actual = substring.CompareTo(other);

            // assert
            Assert.True(actual < 0);
        }