Esempio n. 1
0
        public void FindBundleContainingPathWithWrongPathReturnsNull()
        {
            var container = new BundleContainer(new[] {
                new TestableBundle("~/test")
            });
            var actualBundle = container.FindBundleContainingPath <Bundle>("~/WRONG");

            actualBundle.ShouldBeNull();
        }
Esempio n. 2
0
        public void FindBundleContainingPathOfBundleReturnsTheBundle()
        {
            var expectedBundle = new TestableBundle("~/test");
            var container      = new BundleContainer(new[] {
                expectedBundle
            });
            var actualBundle = container.FindBundleContainingPath <Bundle>("~/test");

            actualBundle.ShouldBeSameAs(expectedBundle);
        }
Esempio n. 3
0
        public void FindBundleContainingPathOfAssetReturnsTheBundle()
        {
            var expectedBundle = new TestableBundle("~/test");
            var asset          = new Mock <IAsset>();

            asset.Setup(a => a.Accept(It.IsAny <IBundleVisitor>()))
            .Callback <IBundleVisitor>(v => v.Visit(asset.Object));
            asset.SetupGet(a => a.SourceFile.FullPath).Returns("~/test/test.js");
            expectedBundle.Assets.Add(asset.Object);
            var container = new BundleContainer(new[] {
                expectedBundle
            });
            var actualBundle = container.FindBundleContainingPath <Bundle>("~/test/test.js");

            actualBundle.ShouldBeSameAs(expectedBundle);
        }
Esempio n. 4
0
 public void FindBundleContainingPathWithWrongPathReturnsNull()
 {
     var container = new BundleContainer(new[] {
         new TestableBundle("~/test")
     });
     var actualBundle = container.FindBundleContainingPath<Bundle>("~/WRONG");
     actualBundle.ShouldBeNull();
 }
Esempio n. 5
0
 public void FindBundleContainingPathOfBundleReturnsTheBundle()
 {
     var expectedBundle = new TestableBundle("~/test");
     var container = new BundleContainer(new[] {
         expectedBundle
     });
     var actualBundle = container.FindBundleContainingPath<Bundle>("~/test");
     actualBundle.ShouldBeSameAs(expectedBundle);
 }
Esempio n. 6
0
 public void FindBundleContainingPathOfAssetReturnsTheBundle()
 {
     var expectedBundle = new TestableBundle("~/test");
     var asset = new Mock<IAsset>();
     asset.Setup(a => a.Accept(It.IsAny<IBundleVisitor>()))
          .Callback<IBundleVisitor>(v => v.Visit(asset.Object));
     asset.SetupGet(a => a.SourceFile.FullPath).Returns("~/test/test.js");
     expectedBundle.Assets.Add(asset.Object);
     var container = new BundleContainer(new[] {
         expectedBundle
     });
     var actualBundle = container.FindBundleContainingPath<Bundle>("~/test/test.js");
     actualBundle.ShouldBeSameAs(expectedBundle);
 }