The idea of the manual is that you test only one logical thing (which can come down to saying a few in some cases) in one test. Therefore, if the test fails, you know the exact reason for its failure and can quickly enter a specific block of code. To take an example from this page , if the next test failed, I know that something is wrong with how the country is extracted / determined in the address type,
public void testCountry() throws Exception { assertEquals("COUNTRY", anAddress.getCountry()); }
Compare this to a multi-statement test version, it may fail for several reasons (and if you are not using the helpful assert messages), you need to debug the test (yuck!).
I will need to see your full test. From what he sees, it seems that you are checking the collection for something not found in the script. In this case, it is recommended that you return an empty collection so that clients do not check for null. Since your test is also a client, life is also simplified: Assert.AreEqual (0, foo.length)
source share