Hi,
I am used to using JMock in Java which allows you to specify things such as any(String.class) as an expected argument - which .NET frameworks offer similar functionality?
Hi,
I am used to using JMock in Java which allows you to specify things such as any(String.class) as an expected argument - which .NET frameworks offer similar functionality?
MOQ has this functionality. I don't know about any of the other available frameworks.
I've used both Rhino Mocks and Moq and they both have this functionality.
MOQ allows you specify constraints, such as
mock.Setup(x => x.DoStuff(It.IsAny<string>())).Returns("Foo");
There are other constraints available as well.
Rhino Mocks have basically the same feature set.
In TypeMock the default is don't care for specific arguments. So unless you want to check specific arguments, you just set up you mock to return whatever needs to be returned.