コード例 #1
0
            public void ShouldThrowExceptionWhenStreamIsTooLong()
            {
                using (var stream = new TestStream(true, true, true))
                {
                    stream.SetLength(long.MaxValue);

                    Assert.Throws <ArgumentException>("length", () =>
                    {
                        new Bytes(stream);
                    });
                }
            }
コード例 #2
0
        public void Constructor_StreamIsTooLong_ThrowsException()
        {
            using (TestStream stream = new TestStream(true, true, true))
            {
                stream.SetLength(long.MaxValue);

                ExceptionAssert.ThrowsArgumentException("length", () =>
                {
                    new Bytes(stream);
                });
            }
        }