rspec/rules/S3981/csharp/rule.adoc

31 lines
477 B
Plaintext
Raw Normal View History

2020-06-30 12:48:39 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
if(collection.Count >= 0){...}
if(enumerable.Count() < 0){...}
if(array.Length >= 0){...}
bool result = array.Length >=0;
----
== Compliant Solution
----
if (list.Any()) { ... }
if (list.Count > 0) { ... }
if (array.Length >= 42) { ... }
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]