protected override void beforeEach()
        {
            _graph = new AssetGraph();

            _assetsForSetA = new[] { "a-1.js", "a-2.js" };
            _assetsForSetB = new[] { "b-1.css", "b-2.css" };

            _assetsForSetC = new[] { "c-1.js", "c-2.js", "c-3.css", "c-4.css" };

            _assetsForSetA.Each(x => _graph.AddToSet("setA", x));
            _assetsForSetB.Each(x => _graph.AddToSet("setB", x));
            _assetsForSetC.Each(x => _graph.AddToSet("setC", x));

            _graph.CompileDependencies(null);

            MockFor <IAssetDependencyFinder>()
            .Stub(x => x.CompileDependenciesAndOrder(new[] { "setA" }))
            .Return(_assetsForSetA);

            MockFor <IAssetDependencyFinder>()
            .Stub(x => x.CompileDependenciesAndOrder(new[] { "setB" }))
            .Return(_assetsForSetB);

            MockFor <IAssetDependencyFinder>()
            .Stub(x => x.CompileDependenciesAndOrder(new[] { "setC" }))
            .Return(_assetsForSetC);

            ClassUnderTest.Apply(null, null, _graph);
        }
コード例 #2
0
ファイル: AssetGraphTester.cs プロジェクト: chadmyers/fubumvc
 public void find_a_set_by_name()
 {
     theGraph.AddToSet("SetA", "A");
     theGraph.ObjectFor("SetA").ShouldBeOfType <AssetSet>();
 }
コード例 #3
0
 public void Includes(string setName, string[] scripts)
 {
     scripts.Each(s => _graph.AddToSet(setName, s));
 }
コード例 #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");
        }
コード例 #5
0
 public void Includes(string setName, string[] scripts)
 {
     CollectionExtensions.Each(scripts, s => _graph.AddToSet(setName, s));
 }