Click here to Skip to main content
15,891,905 members
Articles / Programming Languages / C#
Tip/Trick

Simple.Mocking - new mocking framework for .NET 3.5

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
29 Nov 2009CPOL 11.2K   4  
http://simpled...
http://simpledotnet.codeplex.com/[^]

Tired of unnecessary complex mocking framework with cumbersome record/replay syntax which makes your test code hard to read? Try Simple.Mocking.

* Can mock/fake any interface or delegate
* Refactor friendly syntax, no "magic string" (except for event add/remove)
* No record/replay
* Easy to learn, small API

Example:
var myObject = Mock.Interface<IMyObject>();

Expect.Once.MethodCall(() => myObject.MyMethod(Any<int>.Value)).Returns(0);			


objectUnderTest.DoSomeThing(myObject);


AssertExpectations.IsMetFor(myObject);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Sweden Sweden
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --