public void CKEnumeratorMono_works() { var e = new CKEnumeratorMono<int>( 9 ); Assert.Throws<InvalidOperationException>( () => Console.WriteLine( e.Current ) ); Assert.That( e.MoveNext() ); Assert.That( e.Current, Is.EqualTo( 9 ) ); Assert.That( e.MoveNext(), Is.False ); Assert.Throws<InvalidOperationException>( () => Console.WriteLine( e.Current ) ); e.Reset(); Assert.Throws<InvalidOperationException>( () => Console.WriteLine( e.Current ) ); Assert.That( e.MoveNext() ); Assert.That( e.Current, Is.EqualTo( 9 ) ); Assert.That( e.MoveNext(), Is.False ); Assert.Throws<InvalidOperationException>( () => Console.WriteLine( e.Current ) ); }
public void CKEnumeratorMono_works() { var e = new CKEnumeratorMono <int>(9); Assert.Throws <InvalidOperationException>(() => Console.WriteLine(e.Current)); Assert.That(e.MoveNext()); Assert.That(e.Current, Is.EqualTo(9)); Assert.That(e.MoveNext(), Is.False); Assert.Throws <InvalidOperationException>(() => Console.WriteLine(e.Current)); e.Reset(); Assert.Throws <InvalidOperationException>(() => Console.WriteLine(e.Current)); Assert.That(e.MoveNext()); Assert.That(e.Current, Is.EqualTo(9)); Assert.That(e.MoveNext(), Is.False); Assert.Throws <InvalidOperationException>(() => Console.WriteLine(e.Current)); }
public void CKEnumeratorMono_works() { var e = new CKEnumeratorMono <int>(9); Action a = () => Console.WriteLine(e.Current); a.Should().Throw <InvalidOperationException>(); e.MoveNext().Should().BeTrue(); e.Current.Should().Be(9); e.MoveNext().Should().BeFalse(); a = () => Console.WriteLine(e.Current); a.Should().Throw <InvalidOperationException>(); e.Reset(); a = () => Console.WriteLine(e.Current); a.Should().Throw <InvalidOperationException>(); e.MoveNext().Should().BeTrue(); e.Current.Should().Be(9); e.MoveNext().Should().BeFalse(); a = () => Console.WriteLine(e.Current); a.Should().Throw <InvalidOperationException>(); }