开发者

Moles does not show new Method Signatures after Changes in Class

开发者 https://www.devze.com 2023-03-27 07:31 出处:网络
I had class Voo { private static AnotherClass Doo(int id) { //do some stuff with id then return object of AnotherClass

I had

class Voo
{
  private static AnotherClass Doo(int id)
  {
     //do some stuff with id then return object of AnotherClass
     return x[0];
  }
}

and used this private with moles

MVoo.DooInt32 = delegate ...

NOW I changed the method to:

class Voo
{
  private static AnotherClass Doo(string a, object b)
  {
     //do some stuff with a and b then return object of AnotherClass
     return x[0];
  }
}

BUT moles does not give me the new signature. Sill MVoo.DooIn开发者_如何学Got32 but I expect MVoo.DooStringObject

I removed the moles reference, cleaned, rebuilded. No positive result so far.

Any Ideas?


You need to be sure to delete the mole assembly file (.dll), rebuild the test project without the mole type, and then add it back in. This process is thorough, and has always worked for me, in this situation:

  1. Remove the mole assembly reference from the test project
  2. Delete the .moles file, named after the assembly in question
  3. In Solution Explorer, show all files in the test project
  4. Expand the hidden "MolesAssemblies" folder
  5. Delete the desired _.Moles.dll file and corresponding XML files
  6. Remove (not delete) test files that reference the mole assembly
  7. Rebuild the test project
  8. Select the "Add Moles Assembly" context menu option, on the desired test project reference
  9. Add test files that were temporarily removed from the project
  10. Rebuild the test project


You have to delete your moles file for that assembly something like voo.moles and then create a new one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号