public void Dispose_ThenReadThrowsObjectDisposedException() { var stream = new TextReaderStream(new StringReader(string.Empty)); stream.Dispose(); Assert.Throws <ObjectDisposedException>(() => stream.Read(new byte[10], 0, 10)); }
public void Dispose_AlsoDisposesTextReader() { var readerMock = new Mock <TextReader>(); readerMock.Protected().Setup("Dispose", true).Verifiable(); var stream = new TextReaderStream(readerMock.Object); stream.Dispose(); readerMock.Verify(); }