This one came up in discussion last week and could be worth mentioning.
Consider the following property:
private List<SchemaAttribute> _attributes = new List<SchemaAttribute>();public List<SchemaAttribute> Attributes{ get { return _attributes; } set { _attributes = value; }}
NCover/NCoverExplorer reliably inform me that this property has only 50% coveragein my tests.
By hereto unexplored forces of nature, every consumer of this class calls.Attributes.Add()
or, itterates over it as so:foreach (SchemaAttribute element in instance.Attributes){ // ...}
The keen eye will notice that neither of these ways to access the property actually hit the setter!
Two possible paths present themselves:
Next step? Consult Francesco & Giuseppe!
Sleep. The best 10 hours of the week.
Listening to: Nick Cave and the Bad Seeds - Abattoir Blues
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2008, James Green
E-mail