Sunday, February 13, 2011

What is the best mock framework for VB.NET?

What's the best mocking framework syntax-wise and capability-wise ?

My problem: Most mocking frameworks use lambda expressions now, which are really ugly to write in VB.NET, so is there any framework that has nice syntax without lambdas or has fluent syntax that doesn't need lambdas?

  • rhino mocks.

    But you could have trouble with the new lambda-expression syntax (especially when setting expectations on subs) so either use the new syntax or be prepared to work around it.

    MatrixFrog : I suppose it's too late to ask the downvoter of this answer to explain why. Is there something wrong with Rhino Mocks, or with this answer's explanation of the issues it presents?
    From chrissie1
  • I think capability wise Typemock is the best framework for .Net, instead of working within the runtime it hooks into the CLR and can intercept about any call. This enables you to mock and test anything you want. Some people think it's too powerful. It allows you to test anything while usually the fact that you can't test something is a good warning that there's something wrong with your design. Also it's not free.

    I mainly use Rhino Mocks. It has a really readable syntax, especially the new AAA syntax. Moq is quite new and should be good too, syntax wise. Although I haven't tested it yet.

    From Mendelt
  • Typemock's VB APIs are very simple to use, and it has all kinds of functionality like faking Shared functions.

  • FYI, Isolator has VB.NET specific API so you should be able to use it easily: http://www.typemock.com/vbpage.php

    However, it is a commercial product.

0 comments:

Post a Comment