I have no idea what any of that code is doing so because you haven't given any indication of what any of the objects or methods are. A bit of context might be nice. My guess would be that instead of testing that Length is greater than zero you should test that it's equal to one.