// TODO -- move the unit tests
        public static string DetermineRelativeAssetUrl(IAssetTagSubject subject)
        {
            var folder = subject.Folder;
            var name   = subject.Name;

            return(DetermineRelativeAssetUrl(folder, name));
        }
示例#2
0
        // TODO -- move the unit tests
        public static string DetermineRelativeAssetUrl(IAssetTagSubject subject)
        {
            var folder = subject.Folder;
            var name = subject.Name;

            return DetermineRelativeAssetUrl(folder, name);
        }
        public void skip_over_non_files_in_the_plan()
        {
            var files = new IAssetTagSubject[]{
                new AssetFile("a.js"),
                new AssetFile("b.js"),
                new MissingAssetTagSubject("something.wrong"),
                new AssetFile("c.js"),
                new AssetFile("d.js") ,
                new MissingAssetTagSubject("else.wrong"),
                new AssetFile("e.js")
            };

            var plan = new AssetTagPlan(MimeType.Javascript);
            plan.AddSubjects(files);

            var combos = new CombineAllScriptFiles().DetermineCombinations(plan);

            combos.Count().ShouldEqual(2);

            combos.First().Files.Select(x => x.Name).ShouldHaveTheSameElementsAs("a.js", "b.js");
            combos.Last().Files.Select(x => x.Name).ShouldHaveTheSameElementsAs("c.js", "d.js");
        }
        public void skip_over_non_files_in_the_plan()
        {
            var files = new IAssetTagSubject[] {
                new AssetFile("a.js"),
                new AssetFile("b.js"),
                new MissingAssetTagSubject("something.wrong"),
                new AssetFile("c.js"),
                new AssetFile("d.js"),
                new MissingAssetTagSubject("else.wrong"),
                new AssetFile("e.js")
            };

            var plan = new AssetTagPlan(MimeType.Javascript);

            plan.AddSubjects(files);

            var combos = new CombineAllScriptFiles().DetermineCombinations(plan);

            combos.Count().ShouldEqual(2);

            combos.First().Files.Select(x => x.Name).ShouldHaveTheSameElementsAs("a.js", "b.js");
            combos.Last().Files.Select(x => x.Name).ShouldHaveTheSameElementsAs("c.js", "d.js");
        }