I wrote a simple unit test this past week which was failing unexpectedly. It gave me the classic "What you thought was true, isn't. Better luck next time."
When I debugged the test, I saw that it couldn't find a value in the config. For the sake of example, let's call the variable "AdminUsername".
I knew the code worked, so clearly I had specified it in the service config. What I didn't know is that unit tests need all necessary config values duplicated in the app config of the test project.