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());
 }
示例#2
0
        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());
        }
示例#3
0
        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(""));
        }
示例#4
0
        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");
        }
示例#5
0
        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 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");
        }
示例#7
0
        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();
        }
示例#8
0
 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(""));
 }