When unit testing you sometimes need to test that values are being set to the correct literal/constant value - and this value is often stored in a resources file.
However, for some reason the VS2008 'Create Private Accessor' feature did not work for me for resources (maybe be cause they're all static properties and the generated _Accessor classes need to be instantiated). So to make these resource available within the unit test project I simply made the Resources class public (by default it's internal).
To do this:
- Open the resource file (eg Resources.resx) using the Visual Studio resource editor tool (just double click on the .resx file).
- At the top of the editor tab there is a drop down box labelled "Access Modifier" - change this from Internal to Public and save the file.
- Rebuild the project.
Your resources will now be accessible in your unit tests.
HTH
Tim