user799821
user799821

Reputation: 228

Moles does not show new Method Signatures after Changes in Class

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.DooInt32 but I expect MVoo.DooStringObject

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

Any Ideas?

Upvotes: 1

Views: 303

Answers (2)

Mike Christian
Mike Christian

Reputation: 1536

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

Upvotes: 1

Skomski
Skomski

Reputation: 4870

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

Upvotes: 0

Related Questions