public void AssignAsyncVoidLambdaToAction_TestCodeFix(string oldAssertion, string newAssertion)
        {
            var oldSource = GenerateCode.AsyncFunctionStatement(oldAssertion);
            var newSource = GenerateCode.AsyncFunctionStatement(newAssertion);

            DiagnosticVerifier.VerifyCSharpFix <AsyncVoidCodeFix, AsyncVoidAnalyzer>(oldSource, newSource);
        }
        public void AssignVoidLambdaToAction_TestAnalyzer()
        {
            const string statement = "Action action = () => {};";
            var          source    = GenerateCode.AsyncFunctionStatement(statement);

            DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source);
        }
        public void AssignAsyncVoidLambdaToAction_TestAnalyzer(string assertion)
        {
            var source = GenerateCode.AsyncFunctionStatement(assertion);

            DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
            {
                Id        = AsyncVoidAnalyzer.DiagnosticId,
                Message   = AsyncVoidAnalyzer.Message,
                Locations = new DiagnosticResultLocation[]
                {
                    new DiagnosticResultLocation("Test0.cs", 10, 13)
                },
                Severity = DiagnosticSeverity.Warning
            });
        }