public void GetEnumerator_WithAmountGreaterThanNumberOfElements_ReturnsCorrectResults() { var collection = Enumerable.Range(0, 10); var output = new LastEnumerable <int>(collection, 20); CollectionAssert.AreEqual(new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, output); }
public void GetEnumerator_ForIEnumerableCollectionWhereAmountIsGreaterThanWholeCollection_ReturnsExpectedResult() { var list = Substitute.For <IEnumerable <int> >(); list.GetEnumerator().Returns(Enumerable.Range(0, 10).GetEnumerator()); var output = new LastEnumerable <int>(list, 20).ToList(); CollectionAssert.AreEqual(new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, output); }