コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }