Add() public method

public Add ( IRequestedAsset child ) : void
child IRequestedAsset
return void
Esempio n. 1
0
        public void find_all_scripts_if_just_referring_to_script_files()
        {
            var theSet = new AssetSet();
            theSet.Add("a");
            theSet.Add("b");
            theSet.Add("c");

            theSet.FindScripts(theGraph);

            theSet.AllFileDependencies().Select(x => x.Name).ShouldHaveTheSameElementsAs("a", "b", "c");
        }
Esempio n. 2
0
        public void find_all_scripts_from_a_mix_of_files_and_sets()
        {
            theGraph.AddToSet("1", "A");
            theGraph.AddToSet("1", "B");
            theGraph.AddToSet("1", "C");

            var theSet = new AssetSet();
            theSet.Add("1");
            theSet.Add("D");

            theGraph.AssetSetFor("1").FindScripts(theGraph);
            theSet.FindScripts(theGraph);

            theSet.AllFileDependencies().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D");
        }
Esempio n. 3
0
        public void find_all_scripts_2_deep_child_sets_with_files()
        {
            theGraph.AddToSet("1", "A");
            theGraph.AddToSet("1", "B");
            theGraph.AddToSet("1", "2");
            theGraph.AddToSet("2", "C");
            theGraph.AddToSet("2", "D");

            var theSet = new AssetSet();
            theSet.Add("1");
            theSet.Add("E");

            theGraph.AssetSetFor("1").FindScripts(theGraph);
            theGraph.AssetSetFor("2").FindScripts(theGraph);
            theSet.FindScripts(theGraph);

            theSet.AllFileDependencies().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D", "E");
        }
Esempio n. 4
0
        public void find_all_scripts_if_the_set_refers_to_another_set()
        {
            theGraph.AddToSet("1", "A");
            theGraph.AddToSet("1", "B");
            theGraph.AddToSet("1", "C");

            var theSet = new AssetSet();
            theSet.Add("1");

            theGraph.AssetSetFor("1").FindScripts(theGraph);
            theSet.FindScripts(theGraph);

            theSet.AllFileDependencies().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C");
        }
Esempio n. 5
0
        public void should_be_after_bouncing_through_a_set()
        {
            var s1 = new FileDependency("1");
            var s2 = new FileDependency("2");
            var s3 = new FileDependency("3");

            var set = new AssetSet();
            set.Add(s1);

            s2.AddDependency(set);
            s3.AddDependency(s2);

            s3.MustBeAfter(s1).ShouldBeTrue();
            s3.MustBeAfter(s2).ShouldBeTrue();
        }
Esempio n. 6
0
        public void should_not_return_duplicates()
        {
            theGraph.AddToSet("1", "A");
            theGraph.AddToSet("1", "B");
            theGraph.AddToSet("1", "2");
            theGraph.AddToSet("2", "C");
            theGraph.AddToSet("2", "D");

            var theSet = new AssetSet();
            theSet.Add("1");
            theSet.Add("2");
            theSet.Add("E");

            theGraph.AssetSetFor("1").FindScripts(theGraph);
            theGraph.AssetSetFor("2").FindScripts(theGraph);
            theSet.FindScripts(theGraph);

            theSet.AllFileDependencies().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D", "E");
        }