Mubashar
Mubashar

Reputation: 12668

Mock Framework for .net 1.1

Can somebody share some powerful mocking frameworks for .net 1.1.

I already tried NMock2 it seems that it only mocks the interfaces but i also want to mock classes.

Please also note that in my original code we are doing type checking (on the object I am trying to mock) so I don't think that Interface mocking can help me in anyway.

I know there are some other post related to this but those are usually too old and some of link provided in answers are not not working any more and information seems to be out dated.

Upvotes: 0

Views: 94

Answers (1)

user176134
user176134

Reputation:

There are two different kinds of mocking frameworks:

  1. The free ones like NMock2 (or Moq, FakeItEasy etc.) use an ad-hoc generated proxy class. Thus, they are technically limited to overriding virtual methods and implementing interfaces (which is, technically seen, almost the same).
  2. There is one commercial tool, that works with instrumentation instead of proxy generation: Typemock Isolator. It can fake (not mock) everything, just like you want it. There is also the free MS Moles, but it isn't very user-friendly, because it has a hard-to-read and hard-to-understand 'API'.

The bottom line is: You'll have to pay for what you want.

Btw.: Are you really on NET 1.1?? Then you will have a very hard time finding any tool - not just mocking - that still works with this runtime version. - I suspect that none of the above mentioned will run, because most of the important language features were introduced in later versions. You really should use at least .NET 3.5!

Upvotes: 1

Related Questions