public void ReadTooLargeCount()
 {
     using var st = new Base32768Stream(new StringReader("foo"));
     st.Invoking(st => st.Read(new byte[1], 0, 2))
     .Should().Throw <ArgumentOutOfRangeException>()
     .Which.ParamName.Should().Be("count");
     st.Invoking(st => st.Read(new byte[2], 0, 3))
     .Should().Throw <ArgumentOutOfRangeException>()
     .Which.ParamName.Should().Be("count");
     st.Invoking(st => st.Read(new byte[2], 1, 2))
     .Should().Throw <ArgumentOutOfRangeException>()
     .Which.ParamName.Should().Be("count");
 }
 public void ReadNegativeOffset()
 {
     using var st = new Base32768Stream(new StringReader("foo"));
     st.Invoking(st => st.Read(new byte[0], -1, 0))
     .Should().Throw <ArgumentOutOfRangeException>()
     .Which.ParamName.Should().Be("offset");
 }
 public void ReadNullBuffer()
 {
     using var st = new Base32768Stream(new StringReader("foo"));
     st.Invoking(st => st.Read(null, 0, 0))
     .Should().Throw <ArgumentNullException>()
     .Which.ParamName.Should().Be("buffer");
 }
        public void ReadDisposedStream()
        {
            var st = new Base32768Stream(new StringWriter());

            st.Dispose();
            st.Invoking(st => st.Read(null, 0, 0))
            .Should().Throw <ObjectDisposedException>()
            .Which.ObjectName.Should().Be("Base32768Stream");
        }
 public void ReadWriteStream()
 {
     using var st = new Base32768Stream(new StringWriter());
     st.Invoking(st => st.Read(null, 0, 0))
     .Should().Throw <InvalidOperationException>().WithMessage("The stream is not readable.");
 }
 public void WriteReadStream()
 {
     using var st = new Base32768Stream(new StringReader("foo"));
     st.Invoking(st => st.Write(null, 0, 0))
     .Should().Throw <InvalidOperationException>().WithMessage("The stream is not writable.");
 }