Skip to main content

Add missing cases to switch statement

PropertyValue
IdRR0059
Applicable Syntaxswitch statement
Enabled by Default

Usage

Example #1

before.cs
switch (dayOfWeek)
{
case DayOfWeek.Sunday:
break;
case DayOfWeek.Monday:
break;
case DayOfWeek.Tuesday:
break;
case DayOfWeek.Wednesday:
break;
case DayOfWeek.Thursday:
break;
}
after.cs
switch (dayOfWeek)
{
case DayOfWeek.Sunday:
break;
case DayOfWeek.Monday:
break;
case DayOfWeek.Tuesday:
break;
case DayOfWeek.Wednesday:
break;
case DayOfWeek.Thursday:
break;
case DayOfWeek.Friday:
break;
case DayOfWeek.Saturday:
break;
}

Configuration

roslynator_refactoring.add_missing_cases_to_switch.enabled = true|false