I then did a code coverage analysis of my project.Note that the Code Coverage screens in VS2010 are not the most intuitive, you need to press that cleverly-hidden “Configure” label (why no Button VS team?):

I re-ran the tests and expected some high metrics.

47% – WTF?

Drilling down, I saw that I did not check the internal method.Easy enough to fix, I added

[assembly: InternalsVisibleToAttribute("Com.Tff.Phidget.Tests")]

to my PhidgetException code file (above the namespace, please), wrote a couple of covering Unit Tests

50%????!!!!What is going on here?I have no other methods to cover.Drilling down, I re-learned the lesson of paying too much attention to Code Coverage.Check out the code coverage of the 2 lookup methods.

These lookup methods look like this:

You can see that unless I write 30 covering unit tests for each possible error code and inspect the return value, I will have low code coverage.A good lesson re-learned.