I have to write unit tests for some classes my group is developing. The classes are fairly simple, and I'm not sure how to best test them.
public class MyObjectRegistry
{
private myDataSetMapper = new MyDataSetMapper();
public boolean StoreObjects(list<MyObject> myObjectList)
{
myDataSetMapper.StoreObjects(myObjectList);
}
}
public class MyDataSetMapper
{
public boolean StoreObjects(list<MyObject> myObjectList)
{
for(MyObject myObj: myObjectList)
{
boolean result = StoreObject(myObj);
}
}
private boolean StoreObject(MyObject myObject)
{
//Store the object in a database
}
}
So my question is how to test the MyObjectRegistry.StoreObjects
and MyDataSetWrapper.StoreObjects
methods since there's no real logic other than a foreach
loop and calling out to another method.
I've looked around the web and found that I think I'm looking at a "facade" class/method, but I'm still unclear on what would I should test/assert in the test method.