Exemple #1
0
        public void WriteByte_Throws()
        {
            var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);

            Assert.Throws <NotSupportedException>(() => stream.WriteByte(0));
        }
Exemple #2
0
 public async Task WriteAsync_Throws()
 {
     var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);
     await Assert.ThrowsAsync <NotSupportedException>(() => stream.WriteAsync(new byte[1], 0, 1));
 }
Exemple #3
0
        public void SetLength_Throws()
        {
            var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);

            Assert.Throws <NotSupportedException>(() => stream.SetLength(0));
        }
Exemple #4
0
        public void CanWrite_ReturnsFalse()
        {
            var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);

            Assert.False(stream.CanWrite);
        }
Exemple #5
0
        public void CanRead_ReturnsTrue()
        {
            var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);

            Assert.True(stream.CanRead);
        }
 public async Task FlushAsync_DoesNotThrow()
 {
     var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);
     await stream.FlushAsync();
 }
        public void Flush_DoesNotThrow()
        {
            var stream = new ReferenceReadStream(Mock.Of <Stream>(), 0, 1);

            stream.Flush();
        }