protected UrlGeneratorTestsBase() { UrlModifier.Setup(m => m.Modify(It.IsAny<string>())) .Returns<string>(url => url); UrlGenerator = new UrlGenerator(UrlModifier.Object, SourceDirectory, "cassette.axd/"); }
protected UrlGeneratorTestsBase(bool isFileNameWithHashDisabled) { UrlModifier.Setup(m => m.Modify(It.IsAny<string>())) .Returns<string>(url => url); UrlGenerator = new UrlGenerator(UrlModifier.Object, SourceDirectory, "cassette.axd/", isFileNameWithHashDisabled); }
public void ItRemovesTildeSlashPrefix() { UrlGenerator.CreateAbsolutePathUrl("~/test.png").ShouldEqual("test.png"); }
public void ItCallsUrlModifier() { UrlModifier.Setup(m => m.Modify("test.png")).Returns("/app/test.png"); UrlGenerator.CreateAbsolutePathUrl("~/test.png").ShouldEqual("/app/test.png"); }
protected UrlGenerator_Tests() { UrlModifier.Setup(m => m.PreCacheModify(It.IsAny<string>())) .Returns<string>(url => url); var container = new Mock<ICassetteApplicationContainer<ICassetteApplication>>(); container.SetupGet(c => c.Application.Bundles).Returns(Enumerable.Empty<Bundle>()); UrlGenerator = new UrlGenerator(UrlModifier.Object, "_cassette"); }
public void CreateStylesheetBundleUrlReturnsUrlWithRoutePrefixAndBundleTypeAndPathAndHash() { var url = UrlGenerator.CreateBundleUrl(StubStylesheetBundle("~/test/foo")); url.ShouldEqual("_cassette/stylesheetbundle/test/foo_010203"); }
public void UrlModifierModifyIsCalled() { UrlGenerator.CreateBundleUrl(StubScriptBundle("~/test")); UrlModifier.Verify(m => m.Modify("_cassette/scriptbundle/test_010203")); }
public void ConvertsToForwardSlashes() { var url = UrlGenerator.CreateRawFileUrl("~\\test\\foo.png", "hash"); url.ShouldEqual("_cassette/file/test/foo_hash.png"); }
public void CreateRawFileUrlReturnsUrlWithRoutePrefixAndPathWithoutTildeAndHash() { var url = UrlGenerator.CreateRawFileUrl("~/test.png", "hash"); url.ShouldStartWith("_cassette/file/test_hash.png"); }
public void CreateStylesheetBundleUrlReturnsUrlWithRoutePrefixAndBundleTypeAndHashAndPath() { var url = UrlGenerator.CreateBundleUrl(StubStylesheetBundle("~/test/foo")); url.ShouldEqual("cassette.axd/stylesheet/" + expectedHash + "/test/foo"); }
public void CreateRawFileUrlReturnsUrlWithRoutePrefixAndHashAndPathWithoutTilde() { var url = UrlGenerator.CreateRawFileUrl("~/test.png", "hash"); url.ShouldEqual("cassette.axd/file/test-hash.png"); }
public void InsertsHashBeforeLastPeriod() { var url = UrlGenerator.CreateRawFileUrl("~\\test\\foo.bar.png", "hash"); url.ShouldEqual("cassette.axd/file/test/foo.bar-hash.png"); }
public void ToleratesFilenameWithoutExtension() { var url = UrlGenerator.CreateRawFileUrl("~\\test\\foo", "hash"); url.ShouldEqual("cassette.axd/file/test/foo-hash"); }