Follow @RoyOsherove on Twitter

Isolator feature focus: Live objects in unit tests

Here is one feature that sets Typemock Isolator apart from all the other frameworks, that has nothing to do with legacy code: Live Objects.

This feature allows you to just “new” up an instance of an object, if you can, and then fake method results on it, and send it somewhere into production code:

 [TestMethod, Isolated]
public void DoSomething_LoggerHasFullDisk_NothingHappens()
RealLogger logger = new RealLogger();

Isolate.WhenCalled(()=> logger.IsDiskFull).WillReturn(true);
   new MyClass(logger).DoSomething();..


With any other framework you are forced to “mock” or “stub” the RealLogger class to begin using it. Removing this need makes for clearer more elegant tests. This feature is already available in Isolator 5.1 that was released this week.

Agile Testing tools List

Unit Testing decoupled from TDD as well== Adoption