Inheritance: IRecordedHttpOutput, DescribesItself
        public void SetContentType_replay_writes_the_content_type_to_the_HttpWriter()
        {
            var setContentType = new SetContentType("text/json");
            setContentType.Replay(theHttpWriter);

            theHttpWriter.AssertWasCalled(x => x.WriteContentType("text/json"));
        }
Example #2
0
        public Task Write(string contentType, string renderedOutput)
        {
            output = new SetContentType(contentType);
            output = new WriteTextOutput(renderedOutput);

            return Task.CompletedTask;
        }
Example #3
0
        public Task Write(string contentType, string renderedOutput)
        {
            output = new SetContentType(contentType);
            output = new WriteTextOutput(renderedOutput);

            return(Task.CompletedTask);
        }
Example #4
0
        public void Write(string contentType, Action<Stream> action)
        {
            output = new SetContentType(contentType);

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

            output = new WriteStream(stream);
        }
Example #5
0
        public void Write(string contentType, Action <Stream> action)
        {
            output = new SetContentType(contentType);

            var stream = new MemoryStream();

            action(stream);

            output = new WriteStream(stream);
        }
Example #6
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;
        }
Example #7
0
 public bool Equals(SetContentType other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other._contentType, _contentType));
 }
Example #8
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);
        }
Example #9
0
 public bool Equals(SetContentType other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._contentType, _contentType);
 }
Example #10
0
 public void Write(string contentType, string renderedOutput)
 {
     output = new SetContentType(contentType);
     output = new WriteTextOutput(renderedOutput);
 }
Example #11
0
 public void Write(string contentType, string renderedOutput)
 {
     output = new SetContentType(contentType);
     output = new WriteTextOutput(renderedOutput);
 }