---
title: "TypeMock 3.5 is out - and it's powerful!"
url: "https://osherove.com/blog/2006/7/9/typemock-35-is-out-and-its-powerful.md"
canonical: "https://osherove.com/blog/2006/7/9/typemock-35-is-out-and-its-powerful.html"
published: "2006-07-09T20:12:00"
updated: "2006-07-09T20:12:00"
tags: ["Agile"]
author: "Roy Osherove"
description: "The wizards at TypeMock.com have released a brand new version of TypeMock - one of the coolest Mocking frameorks you've never heard of - and it's a shame you hadn't. (if you're new to this product , look at the bottom…"
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/"
---

# TypeMock 3.5 is out - and it's powerful!

By Roy Osherove July 9, 2006 In [Agile](https://osherove.com/blog/category/agile)

**Historical article** · Originally published July 9, 2006; technical details may be outdated.

The wizards at [TypeMock.com](http://www.typemock.com/) have released a brand new version of TypeMock - one of the coolest Mocking frameorks you've never heard of - and it's a shame you hadn't.

(if you're **new to this product**, look at the bottom of this post for an explanation)

Here are some of the updated features in the new version:

<table><tbody><tr><td><p><strong><span>Natural TypeMocks™</span></strong><b><span><br></span></b><b><span>(Professional and <st1:place><st1:city>Enterprise</st1:city></st1:place> Editions)</span></b><span><o:p></o:p></span></p></td><td><p><span>TypeMock.NET now supports the innovative <a title="file:///D:/TypeMock.NET/TypeMock/WebSite/NaturalMocks.html">Natural TypeMocks™</a> way of defining expectations.<br>Using Natural TypeMocks™ <b>Refactoring</b> and compiler <b>strong typing</b> can be used with mocked objects<o:p></o:p></span></p><table><tbody><tr><td><p><span><span>using</span></span><span> (</span><strong><span>RecordExpectations</span></strong><span> recorder = </span><strong><span>RecorderManager</span></strong><b><span>.</span></b><strong><span>StartRecording</span></strong><span>())<br>{<br></span><span>&nbsp; &nbsp;<span>// CAUTION: ALL calls here are mocked!!!<br></span>&nbsp;&nbsp;&nbsp;<span><b><i>Logger.Log(Logger.NORMAL,<span>null</span>);</i></b></span> <span>// <strong><span>This is mocked</span></strong></span><br>}<span><o:p></o:p></span></span></p></td></tr></tbody></table><p><span>&nbsp;<o:p></o:p></span></p></td></tr><tr><td><p><b><span>Chained Natural TypeMocks™<br></span></b><b><span>(<st1:place><st1:city>Enterprise</st1:city></st1:place> Editions)</span></b><span><o:p></o:p></span></p></td><td><p><span>With Chained Natural TypeMocks™, you can now set expectations to a full sequence of calls<o:p></o:p></span></p><table><tbody><tr><td><p><span><span>using</span></span><span> (<strong><span>RecordExpectations</span></strong> recorder = <strong><span>RecorderManager</span></strong><b>.</b><strong><span>StartRecording</span></strong>())<br>{<span><br></span>&nbsp;&nbsp;&nbsp;<span><b><i>Dogs.GetDog("rusty").Tail.Wag().Speed(5);</i></b></span> <span>// <strong><span>All calls are mocked</span></strong></span><br>}</span><span><o:p></o:p></span></p></td></tr></tbody></table><p><span>&nbsp;<o:p></o:p></span></p></td></tr><tr><td><p><b><span>Better Static Constructor Story</span></b><span><o:p></o:p></span></p></td><td><p><span>TypeMock.NET now handles mocking static constructors in a much better way.<br>Now the static constructor will be called if it was mocked in a previous test and is not the current one</span><span><o:p></o:p></span></p></td></tr><tr><td><p><b><span>Auto-Deploy for Build Servers<br></span></b><b><span>(<st1:place><st1:city>Enterprise</st1:city></st1:place> Editions)</span></b><span><o:p></o:p></span></p></td><td><p><span>It is now possible to run TypeMock.NET tests without installing the software</span><span><o:p></o:p></span></p></td></tr><tr><td><p><b><span>64 bit Side by Side</span></b><span><o:p></o:p></span></p></td><td><p><span>64 bit and 32 bit TypeMock.NET versions can now work together on the same machine.</span><span><o:p></o:p></span></p></td></tr><tr><td><p><b><span>Many other cool things</span></b></p></td><td><span><v:shapetype id="_x0000_t75"><v:stroke></v:stroke><v:formulas><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f></v:formulas><v:path></v:path><o:lock></o:lock></v:shapetype><o:p><ul><li>Ability to Mock ANY Concrete Class and ALL members:<br>Public, Protected, Private, Virtual, Non-virtual, Constructors and Sealed.</li><li>Mocking takes place on the fly, working on your production assemblies.</li><li>Easy expectation recording, giving you full control on mocking.</li><li>Built in argument checks.</li><li>Support <em>ref</em> and <em>out</em> arguments.</li><li>Allow arbitrary calls, or reject any method calls that weren't explicitly expected.</li><li>Enables you to specify sequenced and default return values and exceptions.</li><li>Support for properties and indexes.</li><li>Verify mode, to verify arguments without mocking the code.</li><li>Ability to specify dynamic return values based on passed arguments.</li><li>Enables you to validate the arguments passed to the mocked types.</li><li>Specify custom checking of arguments.</li></ul></o:p></span></td></tr></tbody></table>

**What's TypeMock?**

Basically it allows mocking out (replacing) any object, method or member in your code at runtime. even static method calls, singletons and direct calls to objects can be replaced with "fake" ones, in a few lines of code. That helps write test for code that has a lot of dependencies on other code classes (even web services) without having to change the code to test it.

**Sounds too goo to be true?**

They are doing it using CLR Profilers (an advanced technique that lets you "intercept" any call to any object - even system classes if you want). It's true, but it does have one big shortcoming for me (outlined in red below)

The benefits touted on the website are:

- Enables testing code that was previously 'untestable'.
- Reduces time spent on writing unit tests, giving you more time to focus on your real tasks.
- Cuts development time and increases your efficiency by having repeatable unit test.
- Saves time by eliminating refactoring and restructuring of your code, just to make it testable.
- All this is for **FREE.**

I outlined that line in red to make a point: Part of the beauty of writing unit tests is that it **forces** you to restructure and refactor your code for testability. In fact, Testability can indicate a good design. Which is qhy I don't use this tool in my classes about Test Driven Development.

However, I do see lots of use for this in places where refactoring is impossible, or you need to write integration tests that are very complicated. It can help QA people as well as developers, and I do think it's a very good tool to have in your tool belt.

You just need to know that it hides the idea of good design from you, and lets you plow through your tests as if all is well. That's both good and bad. As long as you know the difference - you're OK.

## More in Agile

[All posts in Agile](https://osherove.com/blog/category/agile)

- Jul 19, 2006

    ### [Oren is grokking Test Driven Development](https://osherove.com/blog/2006/7/19/oren-is-grokking-test-driven-development.html)

- Jul 10, 2006

    ### [TestDriven.NET - Pro and Enterprise editions announced](https://osherove.com/blog/2006/7/10/testdrivennet-pro-and-enterprise-editions-announced.html)

- Jun 29, 2006

    ### [See you at Agile Israel today!](https://osherove.com/blog/2006/6/29/see-you-at-agile-israel-today.html)

- Jun 28, 2006

    ### [NSPec - The evolution of unit tests into behavior description?](https://osherove.com/blog/2006/6/28/nspec-the-evolution-of-unit-tests-into-behavior-description.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/
