protected void SetupTestBundle() { var bundle = new TestableBundle("~/test"); var asset = new StubAsset("~/asset.js", "asset-content"); bundle.Assets.Add(asset); bundle.Hash = new byte[] { 1, 2, 3 }; bundles.Add(bundle); bundles.BuildReferences(); bundle.Process(new CassetteSettings()); }
protected void SetupTestBundle() { var bundle = new TestableBundle("~/test"); var asset = new Mock <IAsset>(); asset.Setup(a => a.OpenStream()) .Returns(() => "asset-content".AsStream()); asset.SetupGet(a => a.Hash).Returns(new byte[] { 1, 2, 3 }); bundle.Assets.Add(asset.Object); bundle.Hash = new byte[] { 1, 2, 3 }; application.Setup(c => c.FindBundleContainingPath <TestableBundle>("~/test")) .Returns(bundle); bundle.Process(new CassetteSettings("")); }
public GivenBundleExists_WhenProcessRequest() { var bundle = new TestableBundle("~/test") { ContentType = "expected-content-type" }; var asset = new StubAsset("~/asset.js", "asset-content"); bundle.Hash = new byte[] { 1, 2, 3 }; bundle.Assets.Add(asset); bundles.Add(bundle); bundles.BuildReferences(); bundle.Process(new CassetteSettings()); var handler = CreateRequestHandler(); handler.ProcessRequest("~/test"); }
public GivenBundleExists_WhenProcessRequest() { var bundle = new TestableBundle("~/test") { ContentType = "expected-content-type" }; var asset = new Mock <IAsset>(); asset.Setup(a => a.OpenStream()) .Returns(() => "asset-content".AsStream()); bundle.Hash = new byte[] { 1, 2, 3 }; bundle.Assets.Add(asset.Object); application.Setup(c => c.FindBundleContainingPath <TestableBundle>("~/test")) .Returns(bundle); bundle.Process(new CassetteSettings("")); var handler = CreateRequestHandler("test_010203"); handler.ProcessRequest(); }
public GivenBundleExists_WhenProcessRequest() { var bundle = new TestableBundle("~/test") { ContentType = "expected-content-type" }; var asset = new Mock<IAsset>(); asset.Setup(a => a.OpenStream()) .Returns(() => "asset-content".AsStream()); bundle.Hash = new byte[] { 1, 2, 3 }; bundle.Assets.Add(asset.Object); application.Setup(c => c.FindBundleContainingPath<TestableBundle>("~/test")) .Returns(bundle); bundle.Process(new CassetteSettings("")); var handler = CreateRequestHandler("test_010203"); handler.ProcessRequest(); }
protected void SetupTestBundle() { var bundle = new TestableBundle("~/test"); var asset = new Mock<IAsset>(); asset.Setup(a => a.OpenStream()) .Returns(() => "asset-content".AsStream()); asset.SetupGet(a => a.Hash).Returns(new byte[] { 1, 2, 3 }); bundle.Assets.Add(asset.Object); bundle.Hash = new byte[] { 1, 2, 3 }; application.Setup(c => c.FindBundleContainingPath<TestableBundle>("~/test")) .Returns(bundle); bundle.Process(new CassetteSettings("")); }