Release Notes

Version 4.0

To view breaking changes, see below.

These are the release notes for the beta version.

Hide C# Code
Hide Visual Basic Code 

 


Natural Mocks™ intelligent recording

Enterprise Edition Only (see Typemock Isolator Editions)
Natural Mocks™ now supports the creation of return values within the recording block, saving even more time and having an easier flow.

using (RecordExpectations recorder = RecorderManager.StartRecording())
{
  // Mock Click Event of next Button
  MockedType.CallMethod();
  recorder.Return(new SomeReturnType(1,2));// SomeReturnType is NOT mocked
}

 


Generic reflective API

Professional Edition Only (see Typemock Isolator Editions)
You can now use generics to create mocks more easily.

Mock theMock = MockManager.Mock<MockedClass>(); 
MockObject<Interface> theMockObject = MockManager.MockObject<Interface>(); 
// mock a generic method
theMock.AlwaysReturn("Method",0,Generic.Method<int>());

Test decorators

Best practices have been embedded in Typemock Isolator; you can use the new syntax.

using (new MockScope()) // Can use timeout too
{
  // Mock and test
  Mock theMock = MockManager.Mock<MockedClass>(); 

  // All mocks will be verified here
}

Professional Edition Only (see Typemock Isolator Editions)
Attribute syntax makes testing even easier.

[TestFixture]
[VerifyMocks] // Verify Mocks after each test. Can use timeout too
public class TestClass
{
  [Test]
  [VerifyMocks(Timeout=150)] // Verify this test
  public void TestVerificationWithTimeout()
  {
  }
}

Syntax includes [VerifyMocks] and [ClearMocks] and works for all testing frameworks.


Custom test decorator

Enterprise Edition Only (see Typemock Isolator Editions)

Typemock Isolator is more than just a mocking framework, and it now enables writing custom test decorators. These are test-framework agnostic and it is simple to add more features to your tests.
Examples:

  • Tracing
  • Database Rollback
  • Repeating

[TestFixture]
[CustomFeature]
public class TestClass
{
  [Test]
  [CustomFeature]
  public void TestVerificationWithTimeout()
  {
  }
}

 


Mock-signed internal interfaces

Typemock Isolator is getting better and you can now mock even internal interfaces in signed assemblies.
Simply add this line to the assembly that needs mocking.

[assembly: InternalsVisibleTo(MockManager.DynamicMocksAssembly)]


30-day evaluation license

Due to the pressure we have creating evaluation licenses, we now give a 30-day trial with each installation.



Natural Mocks™ default mock

New Api recorder.ReturnDefaultImplementation()
returns a mock that has a default behavior.


Support call count for generics

Typemock Isolator now handles the counting of generic types and method invocation.

MockManager.CallCounter<GenericClass>("Method",Generic.Method<int,string>()); 


Support of Visual Studio Orcas Beta 1

Typemock Isolator can run on Visual Studio Orcas Beta 1.


Other fixes

1. Fixed the Save user configuration in the user application folder.
2. Fixed Better Message when reflective mocking a nonexisting method.
3. Fixed the mocking of multiple Chained Static Methods using the default RepeatAlways.

using (RecordExpectations recorder = RecorderManager.StartRecording())
{
  recorder.DefaultBehavior.RepeatAlways();
  MockedClass.Service.foo();
  MockedClass.Service.bar();
}

4. The Build Server (run with Nant/MSBuild script) will not halt the build to show the message box when the license is about to expire.
5. Fixed. AspNetHostingPermission attributes fail Natural Mocks™ in .NET 1.1.
6. Fixed the Generic Return Values and Generic Parameters defined in the mocked type hierarchy.
7. Fixed memory consumption issue.


Breaking changes

Following is a list of breaking changes.

There are now two TypeMock.dll, one for .NET 1.1 and another for .NET 2.0.
Make sure that you reference the correct dll and that the dll in NOT copied locally.

 

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