public void ShouldThrowExceptionWhenStreamIsTooLong() { using (var stream = new TestStream(true, true, true)) { stream.SetLength(long.MaxValue); Assert.Throws <ArgumentException>("length", () => { new Bytes(stream); }); } }
public void Constructor_StreamIsTooLong_ThrowsException() { using (TestStream stream = new TestStream(true, true, true)) { stream.SetLength(long.MaxValue); ExceptionAssert.ThrowsArgumentException("length", () => { new Bytes(stream); }); } }