Пример #1
0
 public async Task AnalyzeWhenTrueIsUsed()
 {
     await TestHelpers.RunAnalysisAsync <ClassicModelAssertUsageAnalyzer>(
         $"{ClassicModelAssertUsageAnalyzerTests.BasePath}{(nameof(this.AnalyzeWhenTrueIsUsed))}.cs",
         new[] { AnalyzerIdentifiers.TrueUsage },
         diagnostics =>
     {
         var diagnostic = diagnostics[0];
         Assert.That(diagnostic.Properties[AnalyzerPropertyKeys.ModelName], Is.EqualTo(nameof(Assert.True)),
                     AnalyzerPropertyKeys.ModelName);
         Assert.That(diagnostic.Properties[AnalyzerPropertyKeys.HasToleranceValue], Is.EqualTo(false.ToString()),
                     AnalyzerPropertyKeys.HasToleranceValue);
     });
 }
Пример #2
0
 public async Task AnalyzeWhenDiagnosticIssuesExist()
 {
     await TestHelpers.RunAnalysisAsync <ClassicModelAssertUsageAnalyzer>(
         $"{ClassicModelAssertUsageAnalyzerTests.BasePath}{(nameof(this.AnalyzeWhenDiagnosticIssuesExist))}.cs",
         Array.Empty <string>());
 }
Пример #3
0
 public async Task AnalyzeWhenInvocationIsNotFromAssert()
 {
     await TestHelpers.RunAnalysisAsync <ClassicModelAssertUsageAnalyzer>(
         $"{ClassicModelAssertUsageAnalyzerTests.BasePath}{(nameof(this.AnalyzeWhenInvocationIsNotFromAssert))}.cs",
         Array.Empty <string>());
 }
Пример #4
0
 public async Task AnalyzeWhenThatIsUsed()
 {
     await TestHelpers.RunAnalysisAsync <ClassicModelAssertUsageAnalyzer>(
         $"{ClassicModelAssertUsageAnalyzerTests.BasePath}{(nameof(this.AnalyzeWhenThatIsUsed))}.cs",
         Array.Empty <string>());
 }