public void GetEnumerator_Success() { SqlErrorCollection c = CreateCollection(); IEnumerator e = c.GetEnumerator(); Assert.NotNull(e); Assert.NotSame(e, c.GetEnumerator()); for (int i = 0; i < 2; i++) { Assert.Throws <InvalidOperationException>(() => e.Current); Assert.True(e.MoveNext()); Assert.Same(c[0], e.Current); Assert.False(e.MoveNext()); Assert.False(e.MoveNext()); Assert.False(e.MoveNext()); Assert.Throws <InvalidOperationException>(() => e.Current); e.Reset(); } }
/// <inheritdoc/> public IEnumerator GetEnumerator() { return(SqlErrorCollection.GetEnumerator()); }