public void IdentifySuggestedFix() { var expected = new DiagnosticResult { Id = "DateTimeNowAnalyser", Message = "Use DateTimeProvider.LocalNow instead of DateTime.Now", Severity = DiagnosticSeverity.Warning, Locations = new[] { new DiagnosticResultLocation("Test0.cs", 10, 27) } }; VerifyCSharpDiagnostic(SourceCodeWithIssue, expected); }
public void ApplySuggestedFix() { var expected = new DiagnosticResult { Id = "DateTimeOffsetNowAnalyser", Message = "Use DateTimeProvider.Now instead of DateTimeOffset.Now", Severity = DiagnosticSeverity.Warning, Locations = new[] {new DiagnosticResultLocation("Test0.cs", 10, 27)} }; VerifyCSharpDiagnostic(SourceCodeWithIssue, expected); VerifyCSharpFix(SourceCodeWithIssue, SourceCodeWithFix, null, true); }