Exemplo n.º 1
0
 public void AddAssembly_is_idempotent()
 {
     _graph.AddDependency(_assembly1, _assembly2);
     _graph.AddDependency(_assembly1, _assembly2);
     _graph.GetAssemblies().Should().Have.Count.EqualTo(2);
     _graph.GetDependantAssemblies(_assembly1).Should().Have.Count.EqualTo(1);
 }
        public void BuildAssemblyDependencyGraph_creates_edges_between_dependencies()
        {
            _graphBuilder.AddAssemblyAndAllDependencies(_testAssembly);
            AssemblyDependencyGraph graph = _graphBuilder.BuildAssemblyDependencyGraph();

            IEnumerable <Assembly> dependencies = graph.GetDependantAssemblies(_testAssembly);

            dependencies.Single(o => o.GetName().Name == "nunit.framework");
            dependencies.Single(o => o.GetName().Name == "Inspector.Engine");
        }
        public void Can_load_external_dlls_from_outside_bin_directory()
        {
            string libDir             = GetLibDirectory();
            string graphSharpFullPath = Path.Combine(libDir, "GraphSharp.dll");

            _graphBuilder.AddAssemblyAndAllDependencies(graphSharpFullPath);
            AssemblyDependencyGraph graph = _graphBuilder.BuildAssemblyDependencyGraph();

            Assembly graphSharpAssembly         = new AssemblyLoader().LoadAssembly(graphSharpFullPath);
            IEnumerable <Assembly> dependencies = graph.GetDependantAssemblies(graphSharpAssembly);

            dependencies.Single(o => o.GetName().Name == "QuickGraph");
        }