Пример #1
0
        public void FindBundleContainingPathWithWrongPathReturnsNull()
        {
            var container = new BundleContainer(new[] {
                new TestableBundle("~/test")
            });
            var actualBundle = container.FindBundlesContainingPath("~/WRONG");

            actualBundle.ShouldBeEmpty();
        }
Пример #2
0
        public void FindBundleContainingPathOfBundleReturnsTheBundle()
        {
            var expectedBundle = new TestableBundle("~/test");
            var container      = new BundleContainer(new[] {
                expectedBundle
            });
            var actualBundle = container.FindBundlesContainingPath("~/test").First();

            actualBundle.ShouldBeSameAs(expectedBundle);
        }
Пример #3
0
        public void FindBundleContainingPathOfAssetReturnsTheBundle()
        {
            var expectedBundle = new TestableBundle("~/test");
            var asset          = new Mock <IAsset>();

            AssetAcceptsVisitor(asset);
            asset.SetupGet(a => a.SourceFile.FullPath).Returns("~/test/test.js");
            expectedBundle.Assets.Add(asset.Object);
            var container = new BundleContainer(new[] {
                expectedBundle
            });
            var actualBundle = container.FindBundlesContainingPath("~/test/test.js").First();

            actualBundle.ShouldBeSameAs(expectedBundle);
        }
Пример #4
0
 public void FindBundleContainingPathWithWrongPathReturnsNull()
 {
     var container = new BundleContainer(new[] {
         new TestableBundle("~/test")
     });
     var actualBundle = container.FindBundlesContainingPath("~/WRONG");
     actualBundle.ShouldBeEmpty();
 }
Пример #5
0
 public void FindBundleContainingPathOfBundleWherePathIsMissingRootPrefixReturnsTheBundle()
 {
     var expectedBundle = new TestableBundle("~/test");
     var container = new BundleContainer(new[] {
         expectedBundle
     });
     var actualBundle = container.FindBundlesContainingPath("test").First();
     actualBundle.ShouldBeSameAs(expectedBundle);
 }
Пример #6
0
 public void FindBundleContainingPathOfAssetReturnsTheBundle()
 {
     var expectedBundle = new TestableBundle("~/test");
     var asset = new Mock<IAsset>();
     AssetAcceptsVisitor(asset);
     asset.SetupGet(a => a.SourceFile.FullPath).Returns("~/test/test.js");
     expectedBundle.Assets.Add(asset.Object);
     var container = new BundleContainer(new[] {
         expectedBundle
     });
     var actualBundle = container.FindBundlesContainingPath("~/test/test.js").First();
     actualBundle.ShouldBeSameAs(expectedBundle);
 }