@@ -343,16 +343,8 @@ static int ReadAndParse()
343343
344344 try
345345 {
346- bool x = true;
347- if (x)
348- {
349- //May throw FormatException, or OverflowException, or return
350- return int.Parse(input);
351- }
352- else
353- {
354- throw new InvalidCastException();
355- }
346+ //May throw FormatException, or OverflowException, or return
347+ return int.Parse(input);
356348 }
357349 catch (FormatException ex)
358350 {
@@ -372,19 +364,17 @@ static int ReadAndParse()
372364 }
373365 """ ;
374366
375- /*
376- var expected = Verifier.Diagnostic(CheckedExceptionsAnalyzer.DiagnosticIdRedundantExceptionDeclaration)
377- .WithArguments("ArgumentException")
378- .WithSpan(11, 55, 11, 72);
367+ var expected = Verifier . Diagnostic ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantExceptionDeclaration )
368+ . WithArguments ( "ArgumentException" )
369+ . WithSpan ( 11 , 55 , 11 , 72 ) ;
379370
380- var expected2 = Verifier.Diagnostic(CheckedExceptionsAnalyzer.DiagnosticIdRedundantCatchAllClause)
381- .WithArguments("ArgumentException")
382- .WithSpan(32, 9, 32, 14);
383- */
371+ var expected2 = Verifier . Diagnostic ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantCatchAllClause )
372+ . WithArguments ( "ArgumentException" )
373+ . WithSpan ( 29 , 9 , 29 , 14 ) ;
384374
385375 await Verifier . VerifyAnalyzerAsync ( test , o =>
386376 {
387- // o.ExpectedDiagnostics.AddRange(expected, expected2);
377+ o . ExpectedDiagnostics . AddRange ( expected , expected2 ) ;
388378
389379 o . DisabledDiagnostics . Remove ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantExceptionDeclaration ) ;
390380 } ) ;
@@ -436,17 +426,13 @@ static int ReadAndParse()
436426 }
437427 """ ;
438428
439- var expected = Verifier . Diagnostic ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantExceptionDeclaration )
440- . WithArguments ( "InvalidUserInputException" )
441- . WithSpan ( 11 , 20 , 11 , 45 ) ;
442-
443- var expected2 = Verifier . Diagnostic ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantCatchAllClause )
429+ var expected = Verifier . Diagnostic ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantCatchAllClause )
444430 . WithArguments ( "ArgumentException" )
445431 . WithSpan ( 33 , 9 , 33 , 14 ) ;
446432
447433 await Verifier . VerifyAnalyzerAsync ( test , o =>
448434 {
449- o . ExpectedDiagnostics . AddRange ( expected , expected2 ) ;
435+ o . ExpectedDiagnostics . AddRange ( expected ) ;
450436
451437 o . DisabledDiagnostics . Remove ( CheckedExceptionsAnalyzer . DiagnosticIdRedundantExceptionDeclaration ) ;
452438 } ) ;
0 commit comments