Is it useful to unit test methods where the only logic is guards?
- by Vaccano
Say I have a method like this:
public void OrderNewWidget(Widget widget)
{
if ((widget.PartNumber > 0) && (widget.PartAvailable))
{
WigdetOrderingService.OrderNewWidgetAsync(widget.PartNumber);
}
}
I have several such methods in my code (the front half to an async Web Service call).
I am debating if it is useful to…