private void MutantAnalyzerOnMutantExecuted(object sender, MutantEventArgs e) { lock (_sync) { var mutant = e.Mutant; var lineNumber = mutant.Mutation.OriginalNode.GetLocation().GetLineSpan().StartLinePosition.Line + 1; var status = $"{Environment.NewLine}Line: {lineNumber} - {mutant.ResultStatus.ToString()} - {mutant.Mutation.DisplayName}".PrintWithDateTimeSimple(); switch (mutant.ResultStatus) { case MutantStatus.Survived: _chalk.Yellow(status); break; case MutantStatus.Timeout: _chalk.Cyan(status); break; case MutantStatus.BuildError: _chalk.Red(status); break; default: _chalk.Green(status); break; } if (EnableDiagnostics) { _chalk.Red($"{Environment.NewLine}{e.BuildLog.ConvertToPlainText()}{Environment.NewLine}"); _chalk.Red($"{Environment.NewLine}{e.TestLog.ConvertToPlainText()}{Environment.NewLine}"); } MutantProgress++; UpdateProgress(); } }
public virtual void OnMutantExecuted(MutantEventArgs args) { MutantExecuted?.Invoke(this, args); }