public void TestNext() { IEnumerable<DayOfWeek> collection = new DayOfWeek[] { DayOfWeek.Monday, DayOfWeek.Friday }; var iterator = new Iterator<DayOfWeek>(collection.GetEnumerator()); Assert.AreEqual(DayOfWeek.Monday, iterator.Next()); Assert.AreEqual(DayOfWeek.Friday, iterator.Next()); ExceptionAssert.Throws<InvalidOperationException>(() => iterator.Next()); }