コード例 #1
0
        public void BundleManifestsAreEqualEvenIfAssetsAreInDifferentOrders()
        {
            var manifest1 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets =
                {
                    new AssetManifest {
                        Path = "~/A"
                    },
                    new AssetManifest {
                        Path = "~/B"
                    }
                }
            };
            var manifest2 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets =
                {
                    new AssetManifest {
                        Path = "~/B"
                    },
                    new AssetManifest {
                        Path = "~/A"
                    }
                }
            };

            manifest1.Equals(manifest2).ShouldBeTrue();
        }
コード例 #2
0
 public BundleManifest_CreateBundle_Tests()
 {
     settings = new CassetteSettings("");
     manifest = new TestableBundleManifest
     {
         Path = "~",
         Hash = new byte[0]
     };
 }
コード例 #3
0
 public BundleManifest_CreateBundle_Tests()
 {
     settings = new CassetteSettings("");
     manifest = new TestableBundleManifest
     {
         Path = "~",
         Hash = new byte[0]
     };
 }
コード例 #4
0
        public void BundleManifestsWithSamePathsButDiffentCasingAreEqual()
        {
            var manifest1 = new TestableBundleManifest {
                Path = "~/PATH"
            };
            var manifest2 = new TestableBundleManifest {
                Path = "~/path"
            };

            manifest1.Equals(manifest2).ShouldBeTrue();
        }
コード例 #5
0
        public void BundleManifestsWithSamePathAndNoAssetsAreEqual()
        {
            var manifest1 = new TestableBundleManifest {
                Path = "~/path"
            };
            var manifest2 = new TestableBundleManifest {
                Path = "~/path"
            };

            manifest1.Equals(manifest2).ShouldBeTrue();
        }
コード例 #6
0
        public void BundleManifestsWithSameAssetsAreEqual()
        {
            var manifest1 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets = { new AssetManifest {
                               Path = "~/asset-path"
                           } }
            };
            var manifest2 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets = { new AssetManifest {
                               Path = "~/asset-path"
                           } }
            };

            manifest1.Equals(manifest2).ShouldBeTrue();
        }
コード例 #7
0
        public void BundleManifestsWithDifferentAssetsAreNotEqual()
        {
            var manifest1 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets = { new AssetManifest {
                               Path = "~/asset-path"
                           } }
            };
            var manifest2 = new TestableBundleManifest
            {
                Path   = "~/path",
                Assets = { new AssetManifest {
                               Path = "~/different-asset-path"
                           } }
            };

            manifest1.Equals(manifest2).ShouldBeFalse();
        }
コード例 #8
0
        public BundleManifestWriter_Tests()
        {
            manifest = new TestableBundleManifest
            {
                Path = "~",
                Hash = new byte[] { 1, 2, 3 },
                ContentType = "content-type",
                PageLocation = "page-location",
                Assets =
                    {
                        new AssetManifest
                        {
                            Path = "~/asset",
                            References =
                                {
                                    new AssetReferenceManifest
                                    {
                                        Path = "~/raw-file/reference",
                                        Type = AssetReferenceType.RawFilename
                                    }
                                }
                        }
                    },
                References =
                    {
                        "~/bundle-reference"
                    },
                HtmlAttributes =
                    {
                        { "attribute", "value" }
                    },
                Content = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
            };

            WriteToElement();
        }
コード例 #9
0
        public BundleManifestWriter_Tests()
        {
            manifest = new TestableBundleManifest
            {
                Path         = "~",
                Hash         = new byte[] { 1, 2, 3 },
                ContentType  = "content-type",
                PageLocation = "page-location",
                Assets       =
                {
                    new AssetManifest
                    {
                        Path       = "~/asset",
                        References =
                        {
                            new AssetReferenceManifest
                            {
                                Path = "~/raw-file/reference",
                                Type = AssetReferenceType.RawFilename
                            }
                        }
                    }
                },
                References =
                {
                    "~/bundle-reference"
                },
                HtmlAttributes =
                {
                    { "attribute", "value" }
                },
                Content = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
            };

            WriteToElement();
        }
コード例 #10
0
 public BundleManifest_IsUpToDateWithFileSystem_Tests()
 {
     tempDirectory = new TempDirectory();
     manifest = new TestableBundleManifest();
     directory = new FileSystemDirectory(tempDirectory);
 }
コード例 #11
0
 public void BundleManifestsWithSamePathsButDiffentCasingAreEqual()
 {
     var manifest1 = new TestableBundleManifest { Path = "~/PATH" };
     var manifest2 = new TestableBundleManifest { Path = "~/path" };
     manifest1.Equals(manifest2).ShouldBeTrue();
 }
コード例 #12
0
 public void BundleManifestsWithSamePathAndNoAssetsAreEqual()
 {
     var manifest1 = new TestableBundleManifest { Path = "~/path" };
     var manifest2 = new TestableBundleManifest { Path = "~/path" };
     manifest1.Equals(manifest2).ShouldBeTrue();
 }
コード例 #13
0
 public void BundleManifestsWithSameAssetsAreEqual()
 {
     var manifest1 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets = { new AssetManifest { Path = "~/asset-path" } }
     };
     var manifest2 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets = { new AssetManifest { Path = "~/asset-path" } }
     };
     manifest1.Equals(manifest2).ShouldBeTrue();
 }
コード例 #14
0
 public void BundleManifestsWithDifferentAssetsAreNotEqual()
 {
     var manifest1 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets = { new AssetManifest { Path = "~/asset-path" } }
     };
     var manifest2 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets = { new AssetManifest { Path = "~/different-asset-path" } }
     };
     manifest1.Equals(manifest2).ShouldBeFalse();
 }
コード例 #15
0
 public void BundleManifestsAreEqualEvenIfAssetsAreInDifferentOrders()
 {
     var manifest1 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets =
             {
                 new AssetManifest { Path = "~/A" },
                 new AssetManifest { Path = "~/B" }
             }
     };
     var manifest2 = new TestableBundleManifest
     {
         Path = "~/path",
         Assets =
             {
                 new AssetManifest { Path = "~/B" },
                 new AssetManifest { Path = "~/A" }
             }
     };
     manifest1.Equals(manifest2).ShouldBeTrue();
 }
コード例 #16
0
 public BundleManifest_IsUpToDateWithFileSystem_Tests()
 {
     tempDirectory = new TempDirectory();
     manifest      = new TestableBundleManifest();
     directory     = new FileSystemDirectory(tempDirectory);
 }