53 lines
760 B
Plaintext
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[]
|