Using JustMock from F#

2 posts, 0 answers
  1. Vagif
    Vagif avatar
    4 posts
    Member since:
    Jul 2010

    Posted 04 Aug 2010 Link to this post

    I tried to compare use of different mock frameworks in F#. While Rhino.Mocks and NSubstitute succeeded with simple tests (I only tried basic things), both Typemock and JustMock failed, and Moq failed in one scenario and succeeded in the other one.

    I blogged about my tests:

    I know this can not be used as a quality measure: F# is a new and very different language. But since it gains larger attention, I believe it's important to provide support for it.

    If Telerik is interested in getting F# support, I can do more tests and investigations. Right now there are simple things that don't work, as you can see from my blog post.
  2. Ricky
    Ricky avatar
    467 posts

    Posted 09 Aug 2010 Link to this post

    Hi Vagif,

    First of all, your detailed blog post on porting mock frameworks to F# looks really nice. Also, the good news is that we have managed to add  the F# style func support to JustMock  just as you do it using Rhino or NSubstitute. To consider an example, let's take the following:

    let monkey = Mock.Create<IMonkey>()
    Mock.Arrange(monkey, fun ignore -> monkey.Echo()).Returns(10).MustBeCalled()  
    let result = monkey.Echo()

    It turns out that you no longer have to do the extra func to lambda conversation for F# while mocking with JustMock.

    P.S. This feature is scheduled to be shipped in the next  public build to be released soon (this week).


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top