public void DisposeBehavior_Property_Should_Be_The_Value_Passed_To_Constructor() { var expected = StreamReaderEnumeratorDisposeBehavior.CloseStreamReader; var sut = new StreamReaderEnumerator(this.testBag.StreamReader, expected); sut.DisposeBehavior.Should().Be(expected); }
public void First_Call_To_MoveNext_Should_Make_Current_Property_Have_First_Line_Of_Expected_String() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.MoveNext(); sut.Current.Should().Be(this.testBag.Line1); }
public void Reset_Should_Put_Stream_Reader_Back_At_Start() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.MoveNext(); sut.Reset(); sut.BaseStreamReader.BaseStream.Position.Should().Be(0); }
public void Second_Call_To_MoveNext_Should_Return_True() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.MoveNext(); sut.MoveNext().Should().BeTrue(); }
public void BaseStreamReader_Property_Should_Have_Same_Instance_Passed_To_Constructor() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.BaseStreamReader.Should().Be(this.testBag.StreamReader); }
public void When_Initialized_Generic_Current_Property_Should_Be_Null() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.Current.Should().BeNull(); }
public void When_Disposed_With_Default_DisposeBehavior_Should_Not_Close_StreamReader() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.Dispose(); this.testBag.StreamReader.Read(); }
public void Third_Call_To_MoveNext_Should_Return_False() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.MoveNext(); sut.MoveNext(); sut.MoveNext().Should().BeFalse(); }
public void Third_Call_To_MoveNext_Should_Make_Current_Property_Have_Second_Line_Of_Expected_String_And_Return_False() { var sut = new StreamReaderEnumerator(this.testBag.StreamReader); sut.MoveNext(); sut.MoveNext(); sut.MoveNext().Should().BeFalse(); sut.Current.Should().Be(this.testBag.Line2); }