Exemple #1
0
        public Report Execute(
            AnalyseDependenciesSettings settings)
        {
            if (settings == null)
            {
                throw new SettingsAreNull("The analyse dependencies settings are null.");
            }

            if (settings.SettingsAreValid() == false)
            {
                throw new SettingsAreInvalid("The analyse dependencies settings are invalid.");
            }

            var analyserService = _analyserServicesFactory.CreateService(settings);

            return(analyserService.Analyse());
        }
Exemple #2
0
        internal IAnalyserService CreateService(
            AnalyseDependenciesSettings settings)
        {
            if (settings.Folder.HasValue)
            {
                return(new FolderAnalyserService(
                           settings.Folder.Value,
                           _dependencyChecker
                           ));
            }

            if (settings.Project.HasValue)
            {
                return(new ProjectAnalyserService(
                           settings.Project.Value,
                           _dependencyChecker
                           ));
            }

            throw new AnalyserServiceIsMissing();
        }