Example #1
0
 public void CreateImageUrlPrependsHandlerRoute()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateImageUrl("~/test.png", "hash");
     url.ShouldStartWith("/_assets/images/");
 }
Example #2
0
 public void ConvertsToForwardSlashes()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateImageUrl("~\\test\\foo.png", "hash");
     url.ShouldEqual("/_assets/images/test/foo_hash_png");
 }
Example #3
0
 public void CreateImageUrlConvertsFileExtensinDotToUnderscore()
 {
     var generator = new UrlGenerator("/");
     var url = generator.CreateImageUrl("~/test.png", "hash");
     url.ShouldStartWith("/_assets/images/test_hash_png");
 }
Example #4
0
 public void ArgumentExceptionThrownWhenFilenameDoesNotStartWithTilde()
 {
     var generator = new UrlGenerator("/");
     Assert.Throws<ArgumentException>(delegate
     {
         generator.CreateImageUrl("fail.png", "hash");
     });
 }