Release Notes

Version 2.3

These are the release notes for version 2.3. 

Hide C# Code
Hide Visual Basic Code


Typemock Isolator can now run with code coverage tools and profilers

Professional and Enterprise Edition Only (see Typemock Isolator Editions)
It is now possible to type-mock your classes and run code coverage tools using our unique technology. You can configure the code coverage tools through a GUI or command line (see Code Coverage with Typemock Isolator).


Conditional expectations

Enterprise Edition Only (see Typemock Isolator Editions)
It is now much easier to set up a mocking infrastructure. Using conditional expectation you can now control different behaviors according to the passed parameters (see Conditional Expectations).
Example:

// C#
   MockManager.Init ();
   Mock theMock = MockManager.Mock(typeof(MyClass)); 
   // return 5 when argument ends with "TypeMock"
   theMock.AlwaysReturn("method",5).When(Check.EndsWith("TypeMock");
   // return 0 is all other cases
   theMock.AlwaysReturn("method",0);
   // continue with test

' Visual Basic
   MockManager.Init()
   Dim theMock As Mock = MockManager.Mock(GetType(MyClass)) 
   ' return 5 when argument ends with "TypeMock"
   theMock.AlwaysReturn("method",5).When(Check.EndsWith("TypeMock")
   ' return 0 is all other cases
   theMock.AlwaysReturn("method",0)
   ' continue with test  

More argument checks

New argument checks have been added:

  • Check.EndsWith(string expected)
    Will check that the passed string ends with the expected value
  • Check.CustomChecker( ParameterCheckerEx checker,Object value)
    Passes the value to the ParameterChecker delegate in ParameterCheckerEventArgs.ExpectedValue

Control your expectations

Enterprise Edition Only (see Typemock Isolator Editions)
It is now much easier to set up a mocking infrastructure. Using expectation blocks, you can now set up expectations for a type in one place and tweak the expectation according to you specific test. For example, suppose all your tests have a complex mock setup with many expectations; 9 out of 10 of your tests expect that "method" to be called but the last test does not. You can now remove unneeded expectation and factor out the expectation setup to one place.
Another example is that all the tests need to set up the complex type, but one test needs to add an expectation somewhere. It is possible to add expectations before a certain position (see Building a Mock Infrastructure).


Auto updater

You can now control the Auto Update feature.


MockObjects now support concrete classes Typemock Isolator now supports the creation of MockObjects from concrete classes. This allows you to instantiate and mock a class. All expectations will apply to the specific instance return by mock.Object.
Unlike other mocks, MockObject does not mock future instances.

Help integrated into Visual Studio Enterprise Edition Only (see Typemock Isolator Editions)
Typemock Isolator's help is now available from within Visual Studio. You can now obtain help on the APIs from within the IDE.

Swapping arguments Enterprise Edition Only (see Typemock Isolator Editions)
Using this innovation feature, you can now swap the actual arguments passed to a mocked method. This is very useful when the code passes a constant or a complex argument to types that will be hard to mock. For example, if your code opens a file that is hard-coded as "filename", you can now swap the name to files that are in the test project (see Swapping Arguments).

Support for multithread and asynchronous code

Typemock Isolator supports testing of multiple threads and asynchronous code.

Verify with VerifyWithTimeout and Typemock Isolator will block the code and wait until all expectations are fulfilled, unless there is a timeout. In either case, VerifyWithTimeout will notify the test thread of all argument validation failures even if they occurred in other threads (see Testing Asynchronous Code).


Retrieving mocks

It is possible to check if a type is mocked and to retrieve the mocks to add and modify expectations on the type (see Retrieving Mocks from the Framework).


Copyright © Typemock Ltd. 2004-2020. All Rights Reserved.