Esempio n. 1
0
        public void Dispose_ThenReadThrowsObjectDisposedException()
        {
            var stream = new TextReaderStream(new StringReader(string.Empty));

            stream.Dispose();
            Assert.Throws <ObjectDisposedException>(() => stream.Read(new byte[10], 0, 10));
        }
Esempio n. 2
0
        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();
        }