Visual Studio 11 shims vs mocks

328 Views Asked by At

Just read about the new Stubs & Shims support in Visual Studio 11.

Stubs are clear to me, but Shims? Are they an alternative for Moles? Or can they be used to do mocking?

1

There are 1 best solutions below

0
On

As I see it, they aren't just the alternative to Moles, they are in fact the replacement. Shims can be used to isolate the code you're testing similarly to Moles.

From the Microsoft Research page on Moles:

The Fakes Framework in Visual Studio 2012 is the next generation of Moles & Stubs. Fakes is different from Moles, however, so moving from Moles to Fakes will require some modifications to your code. The Moles framework will not be supported in Visual Studio 2012.