rspec/rules/S3060/csharp/rule.adoc

25 lines
661 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
There's no valid reason to test ``++this++`` with ``++is++``. The only plausible explanation for such a test is that you're executing code in a parent class conditionally based on the kind of child class ``++this++`` is. But code that's specific to a child class should be _in_ that child class, not in the parent.
2020-06-30 12:48:39 +02:00
== Noncompliant Code Example
----
public class JunkFood
{
public void DoSomething()
{
if (this is Pizza) // Noncompliant
{
// ...
} else if (...
}
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]