Ejemplo n.º 1
0
        public void CompareCountDisposesSecondEnumerator()
        {
            var collection = new BreakingCollection <int>(0);

            using var seq = TestingSequence.Of <int>();

            Assert.AreEqual(0, collection.CompareCount(seq));
        }
Ejemplo n.º 2
0
        public void CompareCountWithCollectionAndCollection(int collectionCount1,
                                                            int collectionCount2,
                                                            int expectedCompareCount)
        {
            var firstCollection  = new BreakingCollection <int>(collectionCount1);
            var secondCollection = new BreakingCollection <int>(collectionCount2);

            Assert.AreEqual(expectedCompareCount, firstCollection.CompareCount(secondCollection));
        }
Ejemplo n.º 3
0
        public void CompareCountDisposesFirstEnumerator()
        {
            var collection = new BreakingCollection <int>(0);

            using (var seq = TestingSequence.Of <int>())
            {
                Assert.AreEqual(0, seq.CompareCount(collection));
            }
        }
Ejemplo n.º 4
0
        public void CompareCountWithSequenceAndCollection(int sequenceCount,
                                                          int collectionCount,
                                                          int expectedCompareCount,
                                                          int expectedMoveNextCallCount)
        {
            var collection = new BreakingCollection <int>(collectionCount);

            using var seq = Enumerable.Range(0, sequenceCount).AsTestingSequence();

            Assert.AreEqual(expectedCompareCount, seq.CompareCount(collection));
            Assert.AreEqual(expectedMoveNextCallCount, seq.MoveNextCallCount);
        }