October 4, 2009 22:14
About 9 months ago I posted a comparison of different mocking frameworks. A lot has changed since then - armloads of bugfixes, gratifying influx of new features, and even a new mocking framework (!) - so time is ripe for a new comparison.
But before I move on, here's a very brief list of changes.
More...
January 18, 2009 22:41
Finishing off this lengthy soliloquy about different mocking frameworks, here's a small summary.
Comparison of different mocking frameworks. NMock2 vs Moq vs Rhino Mocks vs Typemock Isolator - it's all here.
[Update: there's a new comparison available]
More...
December 28, 2008 21:28
A while ago, in order to understand Rhino
Mocks you had to get into its Record/Replay model: record the
expectations first, and then playback the scenario using the mocked
objects.
This has been claimed as clumsy and weird by a lot of people
(especially those who don’t know much about unit testing). Once you get used to
it, it becomes sort of OK, but still it's been considered as a chink in Rhino armor.
In "old" Rhino
Mocks our touch-and-yell
test[1] looks like
[Test]
public void TouchHotIron_Yell()
{
var mocks = new MockRepository();
var hand = mocks.StrictMock<IHand>();
var mouth = mocks.StrictMock<IMouth>();
using (mocks.Record()) {
Expect.Call(() => hand.TouchIron(null)).Constraints(Is.Anything()).Throw(new BurnException());
Expect.Call(mouth.Yell);
}
using (mocks.Playback()) {
var brain = new Brain(hand, mouth);
brain.TouchIron(new Iron { IsHot = true });
}
}
More...