Visual Studio 2010 SP1 and Moling the system dll

Personal reminder because I keep forgetting this step…

Context:

  1. Visual studio 2010 SP1
  2. Moles installed
  3. Building SharePoint unit tests using behaviors
  4. Required to create mole assembly based on the systems.dll
  5. receiving lots of built error including: “System.Net.Moles.SFileWebResponse.Dispose(bool)’: no suitable method found to override”

Try updating the System.moles file to use reflection only:

There I fixed it!

Happy SharePoint unit testing :)

More info:

VN:F [1.9.22_1171]
Rating: 9.3/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +3 (from 3 votes)

Moles are dead, long live Fakes

I’m a huge fan of the Microsoft Research Project called Pex and Moles.
Therefor I’ve mentioned them several times on this blog and demonstrated their power on the community day event in 2010.
Especially moles, because they allow us to fake the very closed SharePoint objects in our Test projects and make our lives as SharePoint legends much easier.

There is bad and good news about Moles:

Moles are dead
The Moles project is *not* actively developed anymore…

Long live fakes
The Fakes Framework in Visual Studio 11 is the next generation of Moles & Stubs, and will eventually replace it.

What now?

The Fakes Framework in Visual Studio 11 is the next generation of Moles & Stubs, and will eventually replace it.
Fakes is different from Moles, however, so moving from Moles to Fakes will require some modifications to your code. A guide for this migration will be available at a later date. Until then, please keep sending bug reports to pexbug@microsoft.com, and ask questions on stackoverflow. The Pex and Moles team will release an update of Pex for Visual Studio 11 when the final release becomes available. Moles will not developed further so we recommend to migrate to Fakes.

http://research.microsoft.com/en-us/projects/moles/

VN:F [1.9.22_1171]
Rating: 9.0/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)