rspec/rules/S4524/csharp/rule.adoc

36 lines
470 B
Plaintext
Raw Normal View History

2020-06-30 12:49:37 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
switch (param)
{
case 0:
DoSomething();
break;
default: // default clause should be the first or last one
Error();
break;
case 1:
DoSomethingElse();
break;
}
----
== Compliant Solution
----
switch (param)
{
case 0:
DoSomething();
break;
case 1:
DoSomethingElse();
break;
default:
Error();
break;
}
----