Inheritance: IRecordedHttpOutput
Exemplo n.º 1
0
        public void Write(string contentType, Action<Stream> action)
        {
            output = new SetContentType(contentType);

            var stream = new MemoryStream();
            action(stream);

            output = new WriteStream(stream);
        }
Exemplo n.º 2
0
        public void Write(string contentType, Action <Stream> action)
        {
            output = new SetContentType(contentType);

            var stream = new MemoryStream();

            action(stream);

            output = new WriteStream(stream);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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!");
        }