public void should_extract_dependencies_from_an_existing_package_config()
        {
            IDependencyExtractor dependencyExtractor = new PackageConfigDependencyExtractor(@"C:\pathToAConfigFile\packages.config");

            IList<Dependency> dependencies = dependencyExtractor.Dependencies();

            Assert.That(dependencies, Is.Not.Null);
            Assert.That(dependencies, Is.Not.Empty);
        }
Exemplo n.º 2
0
        public string Run(string[] args)
        {
            var options = new Options();
            bool result = Parser.Default.ParseArguments(args, options);

            if (result == false)
            {
                // Display the default usage information
                return options.GetUsage();
            }
            else
            {
                if (options.WipeData)
                {
                    _repository.DeleteAll();
                }

                if (!string.IsNullOrEmpty(options.RootPath))
                {
                    var files = _searchFileManager.Search(true);

                    foreach (var file in files)
                    {
                        var dependencyExtractor = new PackageConfigDependencyExtractor(file);
                        _repository.BulkSave(dependencyExtractor.Dependencies());
            #if DEBUG
                        Console.WriteLine("Extracted dependencies from file: {0}", file);
            #endif
                    }

                    return "imported folder " + options.RootPath;
                }

                return "done";
            }
        }