OK, you’ll think I’ve lost it – or maybe you never thought I had it – but I’m creating my own mocking framework.
Why? Well, first of all because I wanted a framework that is more semantically correct and easier to understand so instead of distinguishing between mocks and stubs it just produces “fakes”, if a fake is a mock or a stub depends on the use of it. I also wanted a simpler and cleaner syntax for configuration, I’m really not a fan of the many extension methods cluttering Intellisense in your tests when using Rhino Mocks (although I really love Rhino Mocks).
I also thought it would be a really nice learning experience. Finally there are a few features I think will be cool that I will include that no other framework has (to my knowledge, though I’m only really familiar with Rhino).
But the main feature is and should be ease of use, so, to create a fake object (whether it’s a mock or a stub) you’d write this:
IFoo foo = A.Fake<IFoo>();
I’ll write more about other features, my learning experience while implementing this and post code soon.