Exemple #1
0
        public void IsNoAttachmentWhenDispositionIsMissing()
        {
            var response = new DefaultResponse
            {
                Address = Url.Create("http://example.com/foo.png"),
                Headers = new Dictionary <string, string>
                {
                }
            };

            Assert.IsFalse(response.IsAttachment());
        }
Exemple #2
0
        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());
        }
Exemple #3
0
        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());
        }