This is a class I'm a bit concerned about. My goal is to unit test the addresses list:
public class LabelPrinter
{
private readonly IEnumerable<Address> _addresses;
public LabelPrinter(IEnumerable<Address> addresses)
{
_addresses = addresses;
}
public Document Create()
{
// ... Generate PDF, etc ...
}
}
So what is best:
- Use reflection to inspect the private property, or
- Since the original IEnumerable can be modified from outside anyway, make a public getter and test it instead?