public void UnwritableStreamIsOkay() { var stream = new DisabledMemoryStream(Encoding.ASCII.GetBytes("foo")) { canWrite = false }; var reader = new ReverseLineReader(() => stream); AssertLines(new[] { "foo" }, reader); }
public void UnseekableStreamThrowsExceptionEagerly() { var stream = new DisabledMemoryStream { canSeek = false }; var reader = new ReverseLineReader(() => stream); try { reader.GetEnumerator(); Assert.Fail("Expected exception"); } catch (NotSupportedException) { // Expected } }
public void UnwritableStreamIsOkay() { var stream = new DisabledMemoryStream(Encoding.ASCII.GetBytes("foo")) { canWrite = false }; var reader = new ReverseLineReader(() => stream); AssertLines(new[]{"foo"}, reader); }