Starting to look at NUnit

I want to implement some unit tests for the servicemanager service. Not particularly necessary for something this small, but I want to get a look at NUnit and this little service exists in part as an excuse to try some new technologies out on a small scale.

I’ve been using the Microsoft test facilities at work lately and have not been overly impressed. I’m hoping that NUnit will serve better and it runs under the professional rather than enterprise version of the tools.

I’m a bit torn on the dependency injection front. I have components that use system facilites (SCM, registry and such)…in fact most of what this little service does leans that way. Adding in half-baked mock-ups of SCM and registry classes for injection purposes doesn’t make me happy but building limited capability wrappers that expose only what I need now so that I can intercept things doesn’t make much sense either.

I’m still finding my happy place on the DI/Unit test front it seems.

Full unit test of happy and unhappy path with robust, broad based DI looks to me to add two to three times the amount of work that was required to implement the baseline component. Low fidelity mocks leave the code with half-baked unit tests as mock failures either hide deficiencies or generate their own set of phantom errors. Still hunting a state of grace on this front.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.