public void IsNoAttachmentWhenDispositionIsMissing() { var response = new DefaultResponse { Address = Url.Create("http://example.com/foo.png"), Headers = new Dictionary <string, string> { } }; Assert.IsFalse(response.IsAttachment()); }
public void IsAttachmentWhenContentDispositionHasAttachmentAndFile() { var response = new DefaultResponse { Address = Url.Create("http://example.com/foo.png"), Headers = new Dictionary <string, string> { { HeaderNames.ContentDisposition, "attachment; filename=\"filename.jpg\"" }, } }; Assert.IsTrue(response.IsAttachment()); }
public void IsNoAttachmentWhenDispositionIsInline() { var response = new DefaultResponse { Address = Url.Create("http://example.com/foo.png"), Headers = new Dictionary <string, string> { { HeaderNames.ContentDisposition, "inline" }, } }; Assert.IsFalse(response.IsAttachment()); }