Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« Mock vs. MockObject + Typemock Blog: Tips, Tricks and important things to know | Main | vLite allows you to create a stripped down vista version »
Monday
Feb042008

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.

image

  • 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);
         }

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>