public void testSingleIterator() { var _Enumerator = new SingleEnumerator<String>("marko"); Assert.IsTrue(_Enumerator.MoveNext()); Assert.AreEqual("marko", _Enumerator.Current); Assert.IsFalse(_Enumerator.MoveNext()); // Will throw an InvalidOperationException! Assert.AreEqual(null, _Enumerator.Current); }
public void SingleEnumeratorTest() { var _SingleEnumerator = new SingleEnumerator<UInt64>(123); var _List = new List<UInt64>(); _List.Add(123); var _ListEnumerator = _List.GetEnumerator(); var _List1 = new List<UInt64>(); var _List2 = new List<UInt64>(); while (_SingleEnumerator.MoveNext()) _List1.Add(_SingleEnumerator.Current); while (_ListEnumerator.MoveNext()) _List2.Add(_ListEnumerator.Current); Assert.AreEqual(_List1.Count, _List2.Count); }