rspec/rules/S1862/csharp/rule.adoc

65 lines
1.2 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:47:33 +02:00
include::../description.adoc[]
=== Noncompliant code example
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 12:47:33 +02:00
----
if (param == 1)
{
OpenWindow();
}
else if (param == 2)
{
CloseWindow();
}
else if (param == 1) // Noncompliant
{
MoveWindowToTheBackground();
}
----
=== Compliant solution
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 12:47:33 +02:00
----
if (param == 1)
{
OpenWindow();
}
else if (param == 2)
{
CloseWindow();
}
else if (param == 3)
{
MoveWindowToTheBackground();
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
=== on 25 Mar 2015, 16:03:23 Tamas Vajk wrote:
\[~ann.campbell.2] should I add the See section for C# as well?
=== on 25 Mar 2015, 16:24:48 Ann Campbell wrote:
\[~tamas.vajk] these language-specific subtasks override portions of their parent tasks, and the description field is treated as 5 separate parts: description, Noncompliant Code Example, Compliant Solution, Exceptions, and references (See). There's no need to copy/paste the references to this child ticket, but do include them in the implementation's rule description.
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]