Ejemplo n.º 1
0
        public void FileStreamingHelper_HeaderFileName_base64StringTest_Uppercase()
        {
            var httpContext = new DefaultHttpContext();                       // or mock a `HttpContext`

            httpContext.Request.Headers["filename"] = "VVBQRVJDQVNFLkpQRw=="; //Set header
            var result = FileStreamingHelper.HeaderFileName(httpContext.Request, _appSettings);

            Assert.AreEqual("UPPERCASE.JPG", result);
        }
Ejemplo n.º 2
0
        public void FileStreamingHelper_HeaderFileName_Uppercase()
        {
            var httpContext = new DefaultHttpContext();                // or mock a `HttpContext`

            httpContext.Request.Headers["filename"] = "UPPERCASE.jpg"; //Set header
            var result = FileStreamingHelper.HeaderFileName(httpContext.Request, _appSettings);

            Assert.AreEqual("UPPERCASE.jpg", result);
        }
Ejemplo n.º 3
0
        public void FileStreamingHelper_HeaderFileName_base64StringTest()
        {
            var httpContext = new DefaultHttpContext();                                   // or mock a `HttpContext`

            httpContext.Request.Headers["filename"] = "MjAxOC0wNy0yMCAyMC4xNC41Mi5qcGc="; //Set header
            var result = FileStreamingHelper.HeaderFileName(httpContext.Request, _appSettings);

            Assert.AreEqual("2018-07-20-201452.jpg", result);
        }
Ejemplo n.º 4
0
        public void FileStreamingHelper_HeaderFileName_normalStringTest()
        {
            var httpContext = new DefaultHttpContext();                          // or mock a `HttpContext`

            httpContext.Request.Headers["filename"] = "2018-07-20 20.14.52.jpg"; //Set header
            var result = FileStreamingHelper.HeaderFileName(httpContext.Request, _appSettings);

            Assert.AreEqual("2018-07-20-201452.jpg", result);
        }