public async Task Success_When_IsCSharp() { CSharpCompilation compilation = CSharpCompilation.Create(RoslynUtilities.DefaultCompilationName, null, RoslynUtilities.GetBaseReferences()); IsCSharpCompilationAnalyzer analyzer = new(); ImmutableArray <Diagnostic> diagnostics = await analyzer.RunAnalyzer(compilation); Assert.Empty(diagnostics); }
public async Task Error_When_IsVisualBasic() { VisualBasicCompilation compilation = VisualBasicCompilation.Create(RoslynUtilities.DefaultCompilationName, null, RoslynUtilities.GetBaseReferences()); IsCSharpCompilationAnalyzer analyzer = new(); Assert.True(await analyzer.ProducesDiagnostic(compilation, DurianDiagnostics.DUR0004_DurianModulesAreValidOnlyInCSharp)); }