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

            actualBundle.ShouldBeNull();
        }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
 public void FindBundleContainingPathWithWrongPathReturnsNull()
 {
     var container = new BundleContainer(new[] {
         new TestableBundle("~/test")
     });
     var actualBundle = container.FindBundleContainingPath<Bundle>("~/WRONG");
     actualBundle.ShouldBeNull();
 }
Пример #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);
 }
Пример #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);
 }