Пример #1
0
            public void SortedEnumerable_UpperBound_ItemNotFoundInEmptySequence_ReturnsBitwiseComplementOf0()
            {
                IEnumerable <int>       source = new int[] { };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.UpperBound(3);

                Assert.AreEqual(~0, result, "LowerBound should return the bitwise complement if not found.");
            }
Пример #2
0
            public void SortedEnumerable_UpperBound_ItemNotFoundPastSequence_ReturnsBitwiseComplement()
            {
                IEnumerable <int>       source = new[] { 1, 2, 2, 4 };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.UpperBound(5);

                Assert.AreEqual(~4, result, "LowerBound should return the bitwise complement if not found.");
            }
Пример #3
0
            public void SortedEnumerable_UpperBound_ItemFound_ReturnsUpperBound()
            {
                IEnumerable <int>       source = new[] { 1, 2, 2, 4 };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.UpperBound(2);

                Assert.AreEqual(3, result, "UpperBound should return the upper bound.");
            }