Ejemplo n.º 1
0
            public void should_get_a_list_of_the_packages_in_the_base_directory()
            {
                var basePath = TestDirectory.Get("TestAssets");
                var resolver = new PackageResolver(basePath);

                var packages = resolver.GetPackages();

                Check.That(packages.Extracting("Name"))
                .HasSize(3)
                .And.Contains("Foo", "Bar", "Baz");
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds any packages discovered from the NuGet package graph that was not part of any
        /// references in the code.
        /// </summary>
        private static IEnumerable <PackageInspectionResult> AddMissingExplicitPackages(PackageResolver resolver, NamespaceExclusionList exclusions, List <PackageInspectionResult> results)
        {
            foreach (var package in resolver.GetPackages())
            {
                if (exclusions.IsExcluded(package.Name))
                {
                    continue;
                }

                if (results.Any(result => result.Package.Equals(package)))
                {
                    continue;
                }

                yield return(new PackageInspectionResult(package, new List <IMetricResult?>()));
            }
        }