Following on from my last question "What is a "Stub", I would really like to sit down tonight and play more with creating stub objects.
What is your tool of choice for creating Stub objects?
And for bonus points :)
Can you also link to any good tutorials for getting started with them?
Thanks a lot guys and girls, appreciated :)
FYI - I am using .NET (2.0 @ Work, 3.5 @ Home)
Simply, Rhino.Mocks. Yes, "Mocks Aren't Stubs", but Rhino.Mocks does both. Before wrapping my brain around Rhino.Mocks I hand-coded my own stubs. Never again.
Sorry, I don't get the bonus points. Ayende.com, the place to get Rhino.Mocks, has decent online documentation, and a forum full of questions. The author is actually very good at responding and answering too. I don't feel like there's a good "shortcut" to learning how to use it; for this I think it's through practice and/or trial-and-error that it's best learned.
(In rereading the above, I don't mean it to sound like RTFM even though it may come across that way.)
I have used Rhinomocks for some time now. The problem with it is that it allows all kinds different of strategies and syntaxes for creating mocks and stubs. The object model is getting kind of crowded with all kinds of extension methods, functions and objects that are only useful in certain contexts. This makes it harder to learn.
I'm a fan of the AAA syntax so I'll probably switch to Moq for my next project, it's a bit newer than rhino mocks. It has stolen a couple of good ideas from rhino mocks but has none of the old cruft that rhinomocks has collected over the years. If you're new to mocking and stubbing I'd certainly look into it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With