public DiffMutantFilter(StrykerOptions options, IDiffProvider diffProvider = null, IBaselineProvider baselineProvider = null, IGitInfoProvider gitInfoProvider = null)
        {
            _logger = ApplicationLogging.LoggerFactory.CreateLogger <DiffMutantFilter>();

            _options          = options;
            _gitInfoProvider  = gitInfoProvider ?? new GitInfoProvider(options);
            _baselineProvider = baselineProvider ?? BaselineProviderFactory.Create(options);

            if (options.CompareToDashboard)
            {
                _baseline = GetBaselineAsync().Result;
            }

            _diffResult = diffProvider.ScanDiff();

            if (_diffResult != null)
            {
                _logger.LogInformation("{0} files changed", _diffResult.ChangedSourceFiles?.Count ?? 0 + _diffResult.ChangedTestFiles?.Count ?? 0);

                if (_diffResult.ChangedSourceFiles != null)
                {
                    foreach (var changedFile in _diffResult.ChangedSourceFiles)
                    {
                        _logger.LogInformation("Changed file {0}", changedFile);
                    }
                }
                if (_diffResult.ChangedTestFiles != null)
                {
                    foreach (var changedFile in _diffResult.ChangedTestFiles)
                    {
                        _logger.LogInformation("Changed test file {0}", changedFile);
                    }
                }
            }
        }
示例#2
0
        public static IMutantFilter Create(IStrykerOptions options, IDiffProvider diffProvider = null, IBaselineProvider baselineProvider = null, IGitInfoProvider gitInfoProvider = null)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _diffProvider     = diffProvider ?? new GitDiffProvider(options);
            _baselineProvider = baselineProvider ?? BaselineProviderFactory.Create(options);
            _gitInfoProvider  = gitInfoProvider ?? new GitInfoProvider(options);

            return(new BroadcastMutantFilter(DetermineEnabledMutantFilters(options)));
        }
示例#3
0
        public DashboardMutantFilter(IStrykerOptions options, IBaselineProvider baselineProvider = null, IGitInfoProvider gitInfoProvider = null, IBaselineMutantHelper baselineMutantHelper = null)
        {
            _logger               = ApplicationLogging.LoggerFactory.CreateLogger <DashboardMutantFilter>();
            _baselineProvider     = baselineProvider ?? BaselineProviderFactory.Create(options);
            _gitInfoProvider      = gitInfoProvider ?? new GitInfoProvider(options);
            _baselineMutantHelper = baselineMutantHelper ?? new BaselineMutantHelper();

            _options = options;

            if (options.CompareToDashboard)
            {
                _baseline = GetBaselineAsync().Result;
            }
        }
 public GitBaselineReporter(IStrykerOptions options, IBaselineProvider baselineProvider = null, IGitInfoProvider gitInfoProvider = null)
 {
     _options          = options;
     _baselineProvider = baselineProvider ?? BaselineProviderFactory.Create(options);
     _gitInfoProvider  = gitInfoProvider ?? new GitInfoProvider(options);
 }