Exemple #1
0
        public void Should_GenPrev()
        {
            var lexorank     = LexoRank.Max();
            var prevLexorank = lexorank.GenPrev();

            lexorank.CompareTo(prevLexorank).ShouldBe(1);
        }
Exemple #2
0
        public void Should_Between_MinMax()
        {
            var minRank = LexoRank.Min();
            var maxRank = LexoRank.Max();
            var between = minRank.Between(maxRank);

            between.ToString().ShouldBe("0|hzzzzz:");
            minRank.CompareTo(between).ShouldBeLessThan(0);
            maxRank.CompareTo(between).ShouldBeGreaterThan(0);
        }
Exemple #3
0
        public void Should_Between_MaxGenPrev()
        {
            var maxRank  = LexoRank.Max();
            var prevRank = maxRank.GenPrev();
            var between  = maxRank.Between(prevRank);

            between.ToString().ShouldBe("0|yzzzzz:");
            maxRank.CompareTo(between).ShouldBeGreaterThan(0);
            prevRank.CompareTo(between).ShouldBeLessThan(0);
        }
Exemple #4
0
        public void Should_Between_Middle()
        {
            // Arrange
            var minRank = LexoRank.Min();
            var maxRank = LexoRank.Max();
            // Act
            var middleRank     = LexoRank.Middle();
            var prevMiddleRank = middleRank.GenPrev();
            var nextMiddleRank = middleRank.GenNext();

            // Assert
            middleRank.ToString().ShouldBe("0|hzzzzz:");
            minRank.CompareTo(middleRank).ShouldBeLessThan(0);
            maxRank.CompareTo(middleRank).ShouldBeGreaterThan(0);
            prevMiddleRank.CompareTo(middleRank).ShouldBeLessThan(0);
            nextMiddleRank.CompareTo(middleRank).ShouldBeGreaterThan(0);
        }
Exemple #5
0
        public void Should_IsMax()
        {
            var lexorank = LexoRank.Max();

            lexorank.IsMax().ShouldBeTrue();
        }