Inheritance: Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer, IAnalyzerDetailsReporter, INamedItemSuppresionAttributeDetailsReporter
        public void BasicReassignmentsWithIncorrectlyIngoredVariables_YieldsDiagnostics()
        {
            var analyzer = new AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer();
            var analyzerCommonExpected = new DiagnosticResultCommonProperties(analyzer);
            var analyzerSuppressionCommonExpected =
                new DiagnosticResultCommonProperties(analyzer.GetNamedItemSuppresionAttributeDetails()[0]);

            var expected1 =
                new DiagnosticResult(analyzerSuppressionCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlySuppresionMisuseMessageFormat,
                                            "y"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(11, 26, 29)));

            var expected2 =
                new DiagnosticResult(analyzerSuppressionCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlySuppresionMisuseMessageFormat,
                                            "z"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(11, 31, 34)));

            var expected3 =
                new DiagnosticResult(analyzerCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(16, 13, 18)));

            var expected4 =
                new DiagnosticResult(analyzerCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "b"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(17, 13, 19)));

            var expected5 =
                new DiagnosticResult(analyzerCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "x"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(21, 17, 24)));

            var expected6 =
                new DiagnosticResult(analyzerCommonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "b"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(23, 17, 31)));

            DiagnosticVerifier.VerifyDiagnostics<AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer>(
                @"..\..\CodeUnderTest\CodeToTestVariableReassignment.cs",
                expected1,
                expected2,
                expected3,
                expected4,
                expected5,
                expected6);
        }
        public void NonSimpleIntReassignments_YieldsDiagnostics()
        {
            var analyzer = new AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer();
            var commonExpected = new DiagnosticResultCommonProperties(analyzer);

            var expected1 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(12, 13, 19)));

            var expected2 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(13, 13, 19)));

            var expected3 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(14, 13, 19)));

            var expected4 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(15, 13, 19)));

            var expected5 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(16, 13, 19)));

            var expected6 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(17, 13, 20)));

            var expected7 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(18, 13, 20)));

            var expected8 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(19, 13, 16)));

            var expected9 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(20, 13, 16)));

            var expected10 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(21, 13, 16)));

            var expected11 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "a"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(22, 13, 16)));

            DiagnosticVerifier.VerifyDiagnostics<AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer>(
                @"..\..\CodeUnderTest\CodeToTestNonSimpleIntVariableReassignments.cs",
                expected1,
                expected2,
                expected3,
                expected4,
                expected5,
                expected6,
                expected7,
                expected8,
                expected9,
                expected10,
                expected11);
        }
        public void BooleanReassignments_YieldsDiagnostics()
        {
            var analyzer = new AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer();
            var commonExpected = new DiagnosticResultCommonProperties(analyzer);

            var expected1 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "b"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(11, 13, 22)));

            var expected2 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "b"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(12, 13, 23)));

            var expected3 =
                new DiagnosticResult(commonExpected,
                                     Format(Resources.AA1301VariablesShouldBeAssignedOnceOnlyMessageFormat,
                                            "b"),
                                     Option<DiagnosticLocation>.Some(new DiagnosticLocation(13, 13, 23)));

            DiagnosticVerifier.VerifyDiagnostics<AA1301VariablesShouldBeAssignedOnceOnlyAnalyzer>(
                @"..\..\CodeUnderTest\CodeToTestBooleanVariableReassignments.cs",
                expected1,
                expected2,
                expected3);
        }