Example #1
0
        public static async Task StreamDisposed_ExpectObjectDisposedExceptionAsync()
        {
            var httpRequestStreamReader = new HttpRequestStreamReader(new MemoryStream(), Encoding.UTF8, 10, ArrayPool <byte> .Shared, ArrayPool <char> .Shared);

            httpRequestStreamReader.Dispose();

            await Assert.ThrowsAsync <ObjectDisposedException>(() =>
            {
                return(httpRequestStreamReader.ReadAsync(new char[10], 0, 1));
            });
        }