public int ExcludeAssemblyTest(string exceptions, string wildcards) { var mockRepo = CreateMockRepository(); var stringMatches = !string.IsNullOrEmpty(exceptions) ? exceptions.Split(';').ToList() : new List<string>(); var regii = !string.IsNullOrEmpty(wildcards) ? wildcards.Split(';').Select(w => new Wildcard(w.ToLowerInvariant())).ToList() : new List<Wildcard>(); var auditor = new FeedAuditor(mockRepo, new List<String>(), new List<Regex>(), true, false, false, stringMatches, regii); var results = auditor.Audit(); return results.SelectMany(r => r.UnresolvableReferences).Count(); }
public int ExcludePackageTest(string exceptions, string wildcards) { var mockRepo = CreateMockRepository(); var stringMatches = !string.IsNullOrEmpty(exceptions) ? exceptions.Split(';').ToList() : new List<string>(); var regii = !string.IsNullOrEmpty(wildcards) ? wildcards.Split(';').Select(w => new Wildcard(w.ToLowerInvariant())).ToList() : new List<Wildcard>(); var auditor = new FeedAuditor(mockRepo, stringMatches, regii, true, false, false, new List<String>(), new List<Regex>()); var ignoredCount = 0; auditor.PackageIgnored += (o, e) => ignoredCount++; auditor.Audit(); return ignoredCount; }
private List<PackageAuditResult> RunAuditAndReturnResults(IPackageRepository repository, FeedAuditor feedAuditor) { List<PackageAuditResult> results = null; if (String.IsNullOrEmpty(Package)) results = feedAuditor.Audit(); else { var actualPackage = File.Exists(Package) ? new ZipPackage(Package) : repository.FindPackagesById(Package).FirstOrDefault(); if (actualPackage != null) results = feedAuditor.Audit(actualPackage); else throw new ApplicationException(string.Format("Could not find package locally or on feed: {0}", Package)); } return results; }