public void TooManyLabelsInSwitch()
        {
            var diagnostic = new TooManyLabelsInSwitch {
                Maximum = 2
            };

            Verifier.VerifyAnalyzer(@"TestCases\TooManyLabelsInSwitch.cs", diagnostic);
        }
        private void AddAnalyzerTooManyLabelsInSwitch(ImmutableArray <DiagnosticAnalyzer> .Builder builder)
        {
            var analyzer = new TooManyLabelsInSwitch();

            if (!AnalyzerIds.Contains(analyzer.SupportedDiagnostics.Single().Id))
            {
                return;
            }
            analyzer.Maximum = int.Parse(
                Parameters[analyzer.SupportedDiagnostics.Single().Id].Single()["maximum"],
                NumberStyles.None, CultureInfo.InvariantCulture);
            builder.Add(analyzer);
        }
Esempio n. 3
0
 private void AddAnalyzerTooManyLabelsInSwitch(ImmutableArray<DiagnosticAnalyzer>.Builder builder)
 {
     var analyzer = new TooManyLabelsInSwitch();
     if (!AnalyzerIds.Contains(analyzer.SupportedDiagnostics.Single().Id))
     {
         return;
     }
     analyzer.Maximum = int.Parse(
         Parameters[analyzer.SupportedDiagnostics.Single().Id].Single()["maximum"],
         NumberStyles.None, CultureInfo.InvariantCulture);
     builder.Add(analyzer);
 }
 public void TooManyLabelsInSwitch()
 {
     var diagnostic = new TooManyLabelsInSwitch {Maximum = 2};
     Verifier.Verify(@"TestCases\TooManyLabelsInSwitch.cs", diagnostic);
 }