views:

343

answers:

2

Sometime, when the Unit Test of a class has been done and method use _Accessor while the code has changed. What ever you compile many time it still doesn't "synchronize" the _Accessor file. The only thing that work is closing VS2008 and reopend it. Any trick to "regenerate" the Testing Accessor?

+4  A: 

Open the class where the private/protected method is located. Right click and choose "Create Private Accessor" and choose the proper test project.

Christina Falk
+1  A: 

Regenerating all accessors en masse

  1. Search for all *_accessor.* files in your project folders and delete them (be sure not to delete any files which you have created yourself). Most of these will be found in the Release/debug folders and test folders created by VS.

  2. Rebuild your solution.

Note: Doing a clean or rebuild does not delete the accessor dll/pdb files so we are doing it manually here.

SDX2000
+1 thank, have not tested but seem a good solution.
Daok