public void CompareCountDisposesSecondEnumerator() { var collection = new BreakingCollection <int>(0); using var seq = TestingSequence.Of <int>(); Assert.AreEqual(0, collection.CompareCount(seq)); }
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)); }
public void CompareCountDisposesFirstEnumerator() { var collection = new BreakingCollection <int>(0); using (var seq = TestingSequence.Of <int>()) { Assert.AreEqual(0, seq.CompareCount(collection)); } }
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); }