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