Some things are hard to test, esp unit test. This is one of them. I advise you are careful in such cases, it's easy to spend time on something that adds little value and ends up being a maintenance hassle.