This is a migrated thread and some comments may be shown as answers.

Using JustMock from F#

1 Answer 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vagif
Top achievements
Rank 1
Vagif asked on 04 Aug 2010, 06:05 PM
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:
http://bloggingabout.net/blogs/vagif/archive/2010/08/04/mock-framework-challenges-in-f.aspx

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.

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 09 Aug 2010, 12:10 PM
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()
Mock.Assert(monkey)


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).


Regards,
Ricky

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
Tags
General Discussions
Asked by
Vagif
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or