---
title: "Isolator feature focus: Live objects in unit tests"
url: "https://osherove.com/blog/2008/10/1/isolator-feature-focus-live-objects-in-unit-tests.md"
canonical: "https://osherove.com/blog/2008/10/1/isolator-feature-focus-live-objects-in-unit-tests.html"
published: "2008-10-01T22:37:06"
updated: "2008-10-01T22:37:06"
tags: [".NET", "Agile", "FeatureFocus", "Typemock", "Unit Testing"]
author: "Roy Osherove"
description: "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,…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Isolator feature focus: Live objects in unit tests

By Roy Osherove October 1, 2008 In [.NET](https://osherove.com/blog/category/net), [Agile](https://osherove.com/blog/category/agile), [FeatureFocus](https://osherove.com/blog/category/featurefocus), [Typemock](https://osherove.com/blog/category/typemock), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published October 1, 2008; technical details may be outdated.

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.](http://blog.typemock.com/2008/09/typemock-isolator-51-released.html)

## More in .NET

[All posts in .NET](https://osherove.com/blog/category/net)

- Oct 4, 2008

    ### [BDD: Behavior vs. Spec Frameworks](https://osherove.com/blog/2008/10/4/bdd-behavior-vs-spec-frameworks.html)

- Oct 3, 2008

    ### [Agile Testing tools List](https://osherove.com/blog/2008/10/3/agile-testing-tools-list.html)

- Oct 1, 2008

    ### [Unit Testing decoupled from TDD as well== Adoption](https://osherove.com/blog/2008/10/1/unit-testing-decoupled-from-tdd-as-well-adoption.html)

- Sep 26, 2008

    ### [Unit Testing decoupled from Design == Adoption](https://osherove.com/blog/2008/9/26/unit-testing-decoupled-from-design-adoption.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
