public async Task WriteAsyncWithArrayWorks()
        {
            var expected = new byte[1];

            await WritingStream.WriteAsync(expected, 0, expected.Length);

            Assert.Equal(expected, await ReadFromPipeAsByteArrayAsync());
        }
        public async Task BasicLargeWrite()
        {
            var expected = new byte[8000];

            await WritingStream.WriteAsync(expected);

            Assert.Equal(expected, await ReadFromPipeAsByteArrayAsync());
        }
 public async Task ReadAsyncThrows()
 {
     await Assert.ThrowsAsync <NotSupportedException>(async() => await WritingStream.ReadAsync(new byte[1], 0, 1));
 }
 public void ReadThrows()
 {
     Assert.Throws <NotSupportedException>(() => WritingStream.Read(new byte[1], 0, 1));
 }
 public void SetLengthThrows()
 {
     Assert.Throws <NotSupportedException>(() => WritingStream.SetLength(1));
 }
 public void SeekThrows()
 {
     Assert.Throws <NotSupportedException>(() => WritingStream.Seek(0, SeekOrigin.Begin));
 }
Exemple #7
0
 public async Task WriteStringToStreamAsync(string input)
 {
     await WritingStream.WriteAsync(Encoding.ASCII.GetBytes(input));
 }