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