public void ResponseBodySetPipeReaderReturnsSameValue() { var context = new DefaultProtoContext(); var feature = new ResponseBodyPipeFeature(context); var pipeWriter = new Pipe().Writer; feature.Writer = pipeWriter; Assert.Equal(pipeWriter, feature.Writer); }
public void ResponseBodyReturnsStreamPipeReader() { var context = new DefaultProtoContext(); var expectedStream = new MemoryStream(); context.Response.Body = expectedStream; var feature = new ResponseBodyPipeFeature(context); var pipeBody = feature.Writer; Assert.True(pipeBody is StreamPipeWriter); Assert.Equal(expectedStream, (pipeBody as StreamPipeWriter).InnerStream); }