Typemock Isolator 4.2 Beta released with cool new features (Previously Typemock.NET)
We just released the beta of Typemock Isolator 4.2 beta (Previously just named Typemock.NET). You can get it here.
Some of the cool new things:
- Mocked methods will be highlighted in the debugger if you step into them. in the picture below the "DoSomething()" method is being mocked, so stepping through it means nothing. The line around it signifies this status.
- You can evalutate mocked methods in the deibgger and various watch windows without the original test being affected (so if a mocked method should only return "1" on the first call, even if you evaluate it three times in a watch window it will return "1" in the watch window and also will still work in the test and return "1"
- You can now mock a non-value type fields on a class (used to be that you could just mock out properties)
- Supports running along side DotTrace 3.0
- FinalBuilder Typemock tasks (start,stop, set license + auto deploy)
One of the features which people didn't realize are possible with Typemock is Mock chaining. You could essentially write the following:
using (RecordExpectations r = new RecordExpectations())
{
MyComplexFactory.GetSomeObject().Manager.DoSomething("a");
r.Return(false);
}
if you were using something like RhinoMocks, you'd have to have several stubs that return other stubs: the factory, the object it return, and the manager that object returns. with Typemock it's as trivial as just writing the full call chain and it will just work on the end object as if you did all of that.
You can also write it like this:
using (RecordExpectations r = new RecordExpectations())
{
r.ExpectAndReturn(
MyComplexFactory.GetSomeObject().Manager.DoSomething("a"),
false);
}