I am currently experimenting to find the proper way of creating an HTTP context for unit testing purposes. While examining the stream types created, I was surprised that the following returns a type of System.IO.Stream+NullStream.
var context = new DefaultHttpContext();
var requestBodyType = context.Request.Body.GetType().FullName;
var responseBodyType = context.Response.Body.GetType().FullName;
If the test case requires it, I'd simply replace the stream with a MemoryStream and then act upon it accordingly.
var memoryStream = new MemoryStream();
var context = new DefaultHttpContext();
context.Response.Body = memoryStream;
So far so good. But what exactly is System.IO.Stream+NullStream? I would have expected to find a type of NullStream in the documentation, but couldn't find such a thing.