public void Write(string contentType, Action<Stream> action) { output = new SetContentType(contentType); var stream = new MemoryStream(); action(stream); output = new WriteStream(stream); }
public void Write(string contentType, Action <Stream> action) { output = new SetContentType(contentType); var stream = new MemoryStream(); action(stream); output = new WriteStream(stream); }
public Task Write(string contentType, Func<Stream, Task> action) { output = new SetContentType(contentType); var stream = new MemoryStream(); action(stream); output = new WriteStream(stream); return Task.CompletedTask; }
public Task Write(string contentType, Func <Stream, Task> action) { output = new SetContentType(contentType); var stream = new MemoryStream(); action(stream); output = new WriteStream(stream); return(Task.CompletedTask); }
public void WriteStream_Replay_copies_to_a_stream() { var stream = new MemoryStream(); var writer = new StreamWriter(stream); writer.WriteLine("Hello!"); writer.Flush(); var writeStream = new WriteStream(stream); var recordingWriter = new RecordingHttpWriter(); writeStream.Replay(recordingWriter); recordingWriter.AllText().Trim().ShouldEqual("Hello!"); }