public void ConstructorWithSequentialClassLoop() { var collection = TestIEnumarableData(); CollectionProvider <TestData> provider = new CollectionProvider <TestData>(collection); // go over all elements, and go back to head of list for (int i = 0; i < collection.Count(); i++) { provider.MoveNext(null); } Assert.Equal(collection.First(), provider.Current); }
public void ConstructorWithSequentialInteger() { var collection = TestIEnumarableInt(); CollectionProvider <int> provider = new CollectionProvider <int>(collection); List <int> temp = new List <int>(); for (int i = 0; i < collection.Count(); i++) { temp.Add(provider.Current); provider.MoveNext(null); } Assert.Equal(temp, collection); }