public void TestCountProperty() { var someCollection = new List <string>(); bool result = someCollection.Count >= 0; // Noncompliant {{The count of 'ICollection' is always '>=0', so fix this test to get the real expected behavior.}} // ^^^^^^^^^^^^^^^^^^^^^^^^^ var nonCollection = new FooProperty(); result = nonCollection.Count >= 0; }
public void TestLengthProperty() { var someArray = new string[0]; bool result; result = someArray.Length >= 0; // Noncompliant {{The length of 'Array' is always '>=0', so fix this test to get the real expected behavior.}} // ^^^^^^^^^^^^^^^^^^^^^ result = someArray.LongLength >= 0; // Noncompliant {{The longlength of 'Array' is always '>=0', so fix this test to get the real expected behavior.}} // ^^^^^^^^^^^^^^^^^^^^^^^^^ var nonArray = new FooProperty(); result = nonArray.Length >= 0; result = nonArray.LongLength >= 0; }