Пример #1
0
        /// <summary>
        /// Analyzes assemblies provided by options
        /// </summary>
        /// <param name="options"></param>
        /// <returns>A reporting result for the supplied assemblies</returns>
        public async Task <ReportingResult> AnalyzeAssembliesAsync(IApiPortOptions options)
        {
            var dependencyInfo = _dependencyFinder.FindDependencies(options.InputAssemblies, _progressReport);

            if (dependencyInfo.UserAssemblies.Any())
            {
                AnalyzeRequest request = GenerateRequest(options, dependencyInfo);

                return(await GetResultFromServiceAsync(request, dependencyInfo));
            }
            else
            {
                _progressReport.ReportIssue(LocalizedStrings.NoFilesAvailableToUpload);

                return(null);
            }
        }
Пример #2
0
        private static void CompareFinders(IDependencyFinder finder1, IDependencyFinder finder2, IEnumerable <string> paths)
        {
            var fi = paths.Select(p => new TestAssemblyFile(p));
            var progressReporter = Substitute.For <IProgressReporter>();
            var dependencies1    = finder1.FindDependencies(fi, progressReporter);
            var dependencies2    = finder2.FindDependencies(fi, progressReporter);

            CompareEnumerable(dependencies1.AssembliesWithErrors, dependencies2.AssembliesWithErrors);
            CompareEnumerable(dependencies1.UserAssemblies, dependencies2.UserAssemblies);

            CompareDictionary(dependencies1.UnresolvedAssemblies, dependencies2.UnresolvedAssemblies);
            CompareDictionary(dependencies1.Dependencies, dependencies2.Dependencies);
        }