Esempio n. 1
0
            public void SortedEnumerable_LowerBound_ItemNotFoundInEmptySequence_ReturnsBitwiseComplementOf0()
            {
                IEnumerable <int>       source = new int[] { };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.LowerBound(3);

                Assert.AreEqual(~0, result, "LowerBound should return the bitwise complement if not found.");
            }
Esempio n. 2
0
            public void SortedEnumerable_LowerBound_ItemNotFoundPastSequence_ReturnsBitwiseComplement()
            {
                IEnumerable <int>       source = new[] { 1, 2, 2, 4 };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.LowerBound(5);

                Assert.AreEqual(~4, result, "LowerBound should return the bitwise complement if not found.");
            }
Esempio n. 3
0
            public void SortedEnumerable_LowerBound_ItemFound_ReturnsLowerBound()
            {
                IEnumerable <int>       source = new[] { 1, 2, 2, 4 };
                ISortedEnumerable <int> sorted = source.AsSorted();
                int result = sorted.LowerBound(2);

                Assert.AreEqual(1, result, "LowerBound should return the lower bound.");
            }