Interested in a
Personal Demo ?


Name* :
Please Enter your Name
Company E–Mail* :
Please Enter a Valid Email

Testimonials


"Typemock Isolator is a really great product. The best mocking framework I have used so far."
Mikael Thomsen, Vestas Wind Systems A/S
Success stories

PurchaseOptions


US Toll Free
866–895–4680
Outside US
+44–203–150–0293
Get your printable quote
Buy online

 

Avoid calling 'new' inside Isolator calls

Currently, Typemock Isolator has a limitation, where calling a constructor inside a 'WhenCalled' or 'WasCalled' method invocation can cause runtime problems.

this is a problem:

Isolate.WhenCalled(()=>SomeObject.DoSomething(new OtherObject() )).WillReturn(3);

 

instead, do this:

var myObject = new OtherObject(); 
Isolate.WhenCalled(()=>SomeObject.DoSomething(myObject )).WillReturn(3);