rspec/rules/S4524/csharp/rule.adoc
2022-02-04 16:28:24 +00:00

53 lines
760 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,csharp]
----
switch (param)
{
case 0:
DoSomething();
break;
default: // default clause should be the first or last one
Error();
break;
case 1:
DoSomethingElse();
break;
}
----
== Compliant Solution
[source,csharp]
----
switch (param)
{
case 0:
DoSomething();
break;
case 1:
DoSomethingElse();
break;
default:
Error();
break;
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]