Entries Tagged as Unit Testing

Unit Testing Anybody?

Posted on July 30, 2007 in Unit Testing

So, here I am being the good developer and attempting to put together a series of unit tests for a project (the generic data validation engine is actually very close!). I have always appreciated the concept of unit testing and I have no problem doing it for simple little test cases. Where it always tends to get left by the road side is when I run into one of those more complex scenarios that does not fit the mold.

There was just such an occasion last week and I still have not found a way around it – at least one that I like. So, here is the scenario. I have an object whose init method accepts an optional path to an XML configuration file and if received, parses that configuration file into an internal data structure which is a fairly complex series of nested structures and arrays. All is well and good until I went to write a couple of unit tests for this …. I know I should have written them first, but at least they are being written!