コード例 #1
0
        public async Task MainModuleType_InterfaceType_GoodCase()
        {
            var test = @"
namespace GpxViewer.Modules.Testing.Interface.Messages
{
    public class {|#0:TestMessage|}
    {
        //...
    }
}";

            await CSharpAnalyzerVerifier <ModuleTypeAccessAnalyzer> .VerifyAnalyzerAsync(test);
        }
コード例 #2
0
        public async Task MainModuleType_LogicType_GoodCase()
        {
            var test = @"
namespace GpxViewer.Modules.Testing.Logic
{
    internal class {|#0:TestLogicClass|}
    {
        //...
    }
}";

            await CSharpAnalyzerVerifier <ModuleTypeAccessAnalyzer> .VerifyAnalyzerAsync(test);
        }
コード例 #3
0
        public async Task MainModuleType_LogicType_BadCase()
        {
            var test     = @"
namespace GpxViewer.Modules.Testing.Logic
{
    public class {|#0:TestLogicClass|}
    {
        //...
    }
}";
            var expected = CSharpAnalyzerVerifier <ModuleTypeAccessAnalyzer>
                           .Diagnostic(ModuleTypeAccessAnalyzer.DIAGNOSTIC_ID)
                           .WithLocation(0)
                           .WithArguments("TestLogicClass", "Public", "Internal");

            await CSharpAnalyzerVerifier <ModuleTypeAccessAnalyzer> .VerifyAnalyzerAsync(test, expected);
        }
コード例 #4
0
 public async Task VerifyAnalyzerAsync()
 {
     await CSharpAnalyzerVerifier <SourceAnalyzer> .VerifyAnalyzerAsync(_analyzer.Source);
 }
コード例 #5
0
 public async Task VerifyAnalyzerAsync()
 {
     _analyzerAssertions.AddDiagnosticResult(_diagnosticResult);
     await CSharpAnalyzerVerifier <SourceAnalyzer> .VerifyAnalyzerAsync(_analyzerAssertions.Subject.Source, _analyzerAssertions.DiagnosticResults.ToArray());
 }