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); }
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); }
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); }
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); }