public void find_all_scripts_if_just_referring_to_script_files() { var theSet = new ScriptSet(); theSet.Add("a"); theSet.Add("b"); theSet.Add("c"); theSet.FindScripts(theGraph); theSet.AllScripts().Select(x => x.Name).ShouldHaveTheSameElementsAs("a", "b", "c"); }
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 ScriptSet(); theSet.Add("1"); theSet.Add("D"); theGraph.ScriptSetFor("1").FindScripts(theGraph); theSet.FindScripts(theGraph); theSet.AllScripts().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D"); }
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 ScriptSet(); theSet.Add("1"); theSet.Add("E"); theGraph.ScriptSetFor("1").FindScripts(theGraph); theGraph.ScriptSetFor("2").FindScripts(theGraph); theSet.FindScripts(theGraph); theSet.AllScripts().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D", "E"); }
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 ScriptSet(); theSet.Add("1"); theGraph.ScriptSetFor("1").FindScripts(theGraph); theSet.FindScripts(theGraph); theSet.AllScripts().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C"); }
public void should_be_after_bouncing_through_a_set() { var s1 = new Script("1"); var s2 = new Script("2"); var s3 = new Script("3"); var set = new ScriptSet(); set.Add(s1); s2.AddDependency(set); s3.AddDependency(s2); s3.MustBeAfter(s1).ShouldBeTrue(); s3.MustBeAfter(s2).ShouldBeTrue(); }
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 ScriptSet(); theSet.Add("1"); theSet.Add("2"); theSet.Add("E"); theGraph.ScriptSetFor("1").FindScripts(theGraph); theGraph.ScriptSetFor("2").FindScripts(theGraph); theSet.FindScripts(theGraph); theSet.AllScripts().Select(x => x.Name).ShouldHaveTheSameElementsAs("A", "B", "C", "D", "E"); }