public void AnalyseAssembly_returns_correct_dependency_count_when_assembly_has_no_dependencies() { var dependencyReporter = new DependencyFinder(_assemblyLoader); var dependencies = dependencyReporter.AnalyseAssembly(_mockAssemblyE, PATH); Assert.That(dependencies.Count, Is.EqualTo(0)); }
public void AnalyseAssembly_returns_correct_dependency_count_when_assembly_has_only_one_dependency() { var dependencyReporter = new DependencyFinder(_assemblyLoader); var dependencies = dependencyReporter.AnalyseAssembly(_mockAssemblyC, PATH); Assert.That(dependencies.Count, Is.EqualTo(1)); Assert.That(dependencies[0].ReferencedAssembly, Is.EqualTo(_assemblyNameE)); }
public void AnalyseAssembly_returns_correct_dependency_count_in_the_middle_of_the_chain() { var dependencyReporter = new DependencyFinder(_assemblyLoader); var dependencies = dependencyReporter.AnalyseAssembly(_mockAssemblyB, PATH); Assert.That(dependencies.Count, Is.EqualTo(4)); Assert.That(dependencies.Where(x => x.ReferencedAssembly == _assemblyNameC).Count(), Is.EqualTo(1)); Assert.That(dependencies.Where(x => x.ReferencedAssembly == _assemblyNameD).Count(), Is.EqualTo(1)); Assert.That(dependencies.Where(x => x.ReferencedAssembly == _assemblyNameE).Count(), Is.EqualTo(2)); }
static void Main(string[] args) { if (args.Length < 2) { Console.WriteLine("usage: SevenDigital.Tools.DependencyManager.exe pathContainingAssemblies startingassembly.dll"); return; } var outputPath = args[0]; var assembly = new WrappedAssembly(Assembly.LoadFrom(Path.Combine(outputPath, args[1]))); var finder = new DependencyFinder(new AssemblyLoader()); var dependencies = finder.AnalyseAssembly(assembly, outputPath); var logger = new Logger(); PrintSummary(logger, dependencies); logger.ReadLine(); }