Release Notes

Version 5.1.1

These are the release notes for Release 5.1.1.


Arrange-Act-Assert API  
  • Collection handling in Isolator AAA:
    • New completing statement for WhenCalled():  WillReturnCollectionValuesOf() can be used to replace collection values in the code under test with test data:
    • Isolate.WhenCalled(() => LoggerFactory.Loggers).WillReturnCollectionValuesOf(new[] { new RealLogger(), new RealLogger() });
    • When using  Isolate.WhenCalled() with a chained call containing collection index access, an underlying collection of test data  is automatically created and replaces the collection being modified. The underlying collection values can be iterated on, inspected and modified:
      Isolate.WhenCalled(() => LoggerFactory.Loggers[2].LastMessage).WillReturn("Hello World");
See the Replacing Collections help page for more information.
  • "Duck-type" object swapping: support for swapping one object's method calls with another's. Any calls made on the first object which are supported by the second will be redirected there. Methods that are not supported will continue to return their original implementation. The two objects do not need to be of the same type of have any inheritance relation, and their behavior is matched based solely on the behavior perceived by their contract:
  • Duck duck = new Duck();
    Dog dog = new Dog();

    // swap the duck with the dog
    Isolate.Swap.CallsOn(duck).WithCallsTo(dog);

    // the duck will now behave as a dog for methods with the same signature:
    Assert.AreEqual("Woof!", duck.Talk());
See the Duck Type Swapping help page for more information.
  • Several changes to documentation. Additional AAA examples.

General fixes

In 5.1.1:

  • Improved handling of generic static methods in AAA
  • Fixed evaluation license message dialog alerts which caused test crashes on the last week of evaluation
  • When enabling or disabling Typemock Isolator through the Visual Studio tools menu test runners are reset as well

In 5.1.0:

  • Improved documentation: added documentation pages with examples for AAA features
  • Improved recursive fakes - generally improved the recursive fakes mechanism; specifically:
    • Recursively faking classes with methods returning MSCorLib interfaces
    • Recursive fake SQLConnection, Sharepoint object model (SPWeb)
  • Fixed Tracer crash on load
  • Several exception messages have been cleared up:
    •  Incorrect class name when faking an interface
    • Detailed error message when trying to use WhenCalled() with a method group instead of a lambda expression
    • Fixed error message when encountering a type mismatch in return values when setting up behavior
  • Added support for faking method behavior for methods returning a generic T[]
  • Fixed linker issue that caused linking on 64bit machines to be limited to 64bit linkers


Known Issues
  • Isolator now installs into Program Files->Typemock->Isolator->5.1. When removing former versions, some artifcats on the file system and menus may remain, which can be deleted manually. 
  • A debugger method painting issue causes methods of objects faked through AAA as CallOriginal or Live Objects to be always painted, even if the original implementation is called.
  • When faking behavior for a chained call beginning with a static method for than once, the last behavior may override previous expectations:
  • Isolate.WhenCalled(() => ProductFactory.GetProduct().Name).WillReturn("ProductA");
    Isolate.WhenCalled(() => ProductFactory.GetProduct().Price).WillReturn(100);

    // may fail: the second behavior setting declaration overrid the first.
    Assert.AreEqual("ProductA", ProductFactory.GetProduct.Name);


Breaking changes
  • Obsoleted Isolate.SwapNextInstance() which is replaced by Isolate.Swap.NextInstance(). This is done for consistency with other entries under Isolate.Swap.


 

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