• Testing & ALM

    Sequential and Recursive Mocking with JustMock Free Edition

    December 25, 2010 Share
    [Cross Posted from http://www.skimedic.com/blog] Sequential Mocking One of the trickiest types of code to mock out for testing is recursive methods.  In a typical recursion, the same method is called multiple times, and each time there are typically different parameters passed in, and different return values.  To easily handle this, JustMock gives you two options: Adding InSequence() to each arrange Chaining Returns() calls together. To illustrate the first option, look at the following test: [Test] public void Show_Sequential_InSequence_Arrange_Option() { var service = Mock.Create<IService>(); Mock.Arrange(() => service.GetSum(Arg.AnyInt, Arg.AnyInt)) .Returns(4).InSequence(); Mock.Arrange(()...
  • Testing & ALM

    Introducing JustMock Free Edition

    December 15, 2010 Share
    [Cross posted from .NET Musings] Technorati Tags: mocking,.NET,Testing,TDD,BDD,JustMock,Telerik Today Telerik launched a free edition of it’s commercial mocking tool, JustMock Free Edition.  The commercial version of JustMock has been out now for a while, and brings incredible power to the table, such as mocking sealed and static classes, non-public members and types, as well as many more features.  For more information on the commercial version of JustMock, see  http://www.telerik.com/products/mocking.aspx. I do a lot of testing.  I am addicted to TDD/BDD, and can’t live without a mocking tool. The new (or “greenfield”) code that I develop is based on interfaces, SOLID, etc., and I don’t always...