예제 #1
0
 string CreateOutputFilename(string sourceFilename)
 {
     return(urlGenerator.CreateRawFileUrl(sourceFilename));
 }
예제 #2
0
 string CreateOutputFilename(string sourceFilename, string absoluteSourceFilename)
 {
     return(urlGenerator.CreateRawFileUrl(sourceFilename, HashFileContents(absoluteSourceFilename)));
 }
예제 #3
0
 public void CreateImageUrlPrependsHandlerRoute()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateRawFileUrl("~/test.png", "hash");
     url.ShouldStartWith("/_assets/images/");
 }
예제 #4
0
 public void CreateImageUrlConvertsFileExtensinDotToUnderscore()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateRawFileUrl("~/test.png", "hash");
     url.ShouldStartWith("/_assets/images/test_hash_png");
 }
예제 #5
0
 public void ConvertsToForwardSlashes()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateRawFileUrl("~\\test\\foo.png", "hash");
     url.ShouldEqual("/_assets/images/test/foo_hash_png");
 }
예제 #6
0
 public void ArgumentExceptionThrownWhenFilenameDoesNotStartWithTilde()
 {
     var generator = new UrlGenerator("/");
     Assert.Throws<ArgumentException>(delegate
     {
         generator.CreateRawFileUrl("fail.png", "hash");
     });
 }