Example #1
0
        public void IntersectWithIEnumerableTest()
        {
            var intSet = new Kibnet.IntSet(TestHelper.GetEnumerable(100000, 100));

            var intSet2 = TestHelper.GetEnumerable(10000, 0);

            intSet.IntersectWith(intSet2);

            var last       = 99;
            var enumerable = intSet as IEnumerable;

            Assert.Equal(100, intSet.First());
            foreach (int i in enumerable)
            {
                Assert.Equal(last + 1, i);
                last = i;
            }
            Assert.Equal(10000, intSet.Last());
        }