public void TestSortedMergeSequenceNullException()
        {
            const IEnumerable <int> sequenceA = null;
            var sequenceB = new BreakingSequence <int>();

            sequenceA.SortedMerge(OrderByDirection.Ascending, sequenceB);
        }
        public void TestSortedMergeOtherSequencesNullException()
        {
            var sequenceA = new BreakingSequence <int>();

            Assert.ThrowsArgumentNullException("otherSequences", () =>
                                               sequenceA.SortedMerge(OrderByDirection.Ascending, (IEnumerable <int>[])null));
        }
Exemple #3
0
        public void TestInterleaveDoNotCallGetEnumeratorEagerly()
        {
            var sequenceA = TestingSequence.Of(1);
            var sequenceB = new BreakingSequence <int>();

            sequenceA.Interleave(sequenceB).Take(1).Consume();
        }
Exemple #4
0
        public void IndexIsLazy()
        {
            var bs = new BreakingSequence <object>();

            bs.Index();
            bs.Index(0);
        }
Exemple #5
0
        public void TestSortedMergeIsLazy()
        {
            var sequenceA = new BreakingSequence <int>();
            var sequenceB = new BreakingSequence <int>();

            sequenceA.SortedMerge(OrderByDirection.Ascending, sequenceB);
        }
Exemple #6
0
        public void FullGroupIsLazy()
        {
            var bs  = new BreakingSequence <int>();
            var bf  = BreakingFunc.Of <int, int>();
            var bfg = BreakingFunc.Of <int, IEnumerable <int>, IEnumerable <int>, int>();

            bs.FullGroupJoin(bs, bf, bf, bfg);
        }
        public void FullGroupIsLazy()
        {
            var listA = new BreakingSequence <int>();
            var listB = new BreakingSequence <int>();

            listA.FullGroupJoin(listB, x => x, x => x, BreakingFunc.Of <int, IEnumerable <int>, IEnumerable <int>, int>());
            Assert.True(true);
        }
Exemple #8
0
        public void TestInterleaveDisposesOnErrorAtGetEnumerator()
        {
            using var sequenceA = TestingSequence.Of <int>();
            var sequenceB = new BreakingSequence <int>();

            // Expected and thrown by BreakingSequence
            Assert.Throws <InvalidOperationException>(() => sequenceA.Interleave(sequenceB).Consume());
        }
        public void TestSortedMergeSequenceNullException()
        {
            const IEnumerable <int> sequenceA = null;
            var sequenceB = new BreakingSequence <int>();

            Assert.ThrowsArgumentNullException("source", () =>
                                               sequenceA.SortedMerge(OrderByDirection.Ascending, sequenceB));
        }
        public void FullGroupIsLazy()
        {
            var listA = new BreakingSequence <int>();
            var listB = new BreakingSequence <int>();

            listA.FullGroupJoin(listB, x => x, x => x, DummySelector);
            Assert.True(true);
        }
        public void GroupAdjacentIsLazy()
        {
            var bs = new BreakingSequence <object>();

            bs.GroupAdjacent(delegate { return(0); });
            bs.GroupAdjacent(delegate { return(0); }, o => o);
            bs.GroupAdjacent(delegate { return(0); }, o => o, EqualityComparer <int> .Default);
            bs.GroupAdjacent(delegate { return(0); }, EqualityComparer <int> .Default);
        }
Exemple #12
0
        public void LeftJoinIsLazy()
        {
            var xs = new BreakingSequence <int>();
            var ys = new BreakingSequence <object>();

            Assert.DoesNotThrow(() =>
                                xs.LeftJoin(ys, x => x, y => y.GetHashCode(),
                                            BreakingFunc.Of <int, object>(),
                                            BreakingFunc.Of <int, object, object>()));
        }
Exemple #13
0
        public void LeftJoinWithHomogeneousSequencesIsLazy()
        {
            var xs = new BreakingSequence <int>();
            var ys = new BreakingSequence <int>();

            Assert.DoesNotThrow(() =>
                                xs.LeftJoin(ys, e => e,
                                            BreakingFunc.Of <int, object>(),
                                            BreakingFunc.Of <int, int, object>()));
        }
Exemple #14
0
        public void RightJoinWithComparerIsLazy()
        {
            var xs = new BreakingSequence <int>();
            var ys = new BreakingSequence <object>();

            Assert.DoesNotThrow(() =>
                                xs.RightJoin(ys, x => x.GetHashCode(), y => y,
                                             BreakingFunc.Of <object, object>(),
                                             BreakingFunc.Of <int, object, object>(),
                                             comparer: null));
        }
Exemple #15
0
        public void RightJoinWithHomogeneousSequencesWithComparerIsLazy()
        {
            var xs = new BreakingSequence <int>();
            var ys = new BreakingSequence <int>();

            Assert.DoesNotThrow(() =>
                                xs.RightJoin(ys, e => e,
                                             BreakingFunc.Of <int, object>(),
                                             BreakingFunc.Of <int, int, object>(),
                                             comparer: null));
        }
Exemple #16
0
        public void GroupAdjacentIsLazy()
        {
            var bs  = new BreakingSequence <object>();
            var bf  = BreakingFunc.Of <object, int>();
            var bfo = BreakingFunc.Of <object, object>();
            var bfg = BreakingFunc.Of <int, IEnumerable <object>, IEnumerable <object> >();

            bs.GroupAdjacent(bf);
            bs.GroupAdjacent(bf, bfo);
            bs.GroupAdjacent(bf, bfo, EqualityComparer <int> .Default);
            bs.GroupAdjacent(bf, EqualityComparer <int> .Default);
            bs.GroupAdjacent(bf, bfg);
            bs.GroupAdjacent(bf, bfg, EqualityComparer <int> .Default);
        }
Exemple #17
0
        public void ZipIsLazy()
        {
            var bs = new BreakingSequence <int>();

            bs.EquiZip <int, int, int>(bs, delegate { throw new NotImplementedException(); });
        }
Exemple #18
0
        public void ZipShortestIsLazy()
        {
            var bs = new BreakingSequence <int>();

            bs.ZipShortest(bs, BreakingFunc.Of <int, int, int>());
        }
Exemple #19
0
        public void ExceptByIsLazyWithComparer()
        {
            var bs = new BreakingSequence <string>();

            bs.ExceptBy(bs, BreakingFunc.Of <string, string>(), StringComparer.Ordinal);
        }
        public void TestSortedMergeOtherSequencesNullException()
        {
            var sequenceA = new BreakingSequence <int>();

            sequenceA.SortedMerge(OrderByDirection.Ascending, (IEnumerable <int>[])null);
        }
Exemple #21
0
        public void ZipIsLazy()
        {
            var bs = new BreakingSequence <int>();

            bs.EquiZip(bs, BreakingFunc.Of <int, int, int>());
        }
Exemple #22
0
        public void ExceptByIsLazy()
        {
            var bs = new BreakingSequence <string>();

            bs.ExceptBy(bs, BreakingFunc.Of <string, int>());
        }