Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Unit Testing Accessor, how to re-generate them without closing VS?

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?

like image 650
Patrick Desjardins Avatar asked Jun 19 '09 19:06

Patrick Desjardins


2 Answers

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

like image 200
Christina Falk Avatar answered Nov 15 '22 05:11

Christina Falk


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.

like image 25
Autodidact Avatar answered Nov 15 '22 07:11

Autodidact