---
title: "Is Moq too poweful?"
url: "https://osherove.com/blog/2008/7/6/is-moq-too-poweful.md"
canonical: "https://osherove.com/blog/2008/7/6/is-moq-too-poweful.html"
published: "2008-07-06T11:59:28"
updated: "2008-07-06T11:59:28"
tags: ["Agile", "Agile Related", "Unit Testing"]
author: "Roy Osherove"
description: "It's interesting to see the other mocking frameworks as they grow into maturity. Especially Moq which has been getting loads of new features recently. The latest one is something which makes me feel a bit weird after…"
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/"
---

# Is Moq too poweful?

By Roy Osherove July 6, 2008 In [Agile](https://osherove.com/blog/category/agile), [Agile Related](https://osherove.com/blog/category/agile-related), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published July 6, 2008; technical details may be outdated.

It's interesting to see the other mocking frameworks as they grow into maturity. Especially Moq [which has been getting loads](http://www.clariusconsulting.net/blogs/kzu/archive/2008/07/05/MockingprotectedmemberswithMoq.aspx) of new features recently. The latest one is something which makes me feel a bit weird after reading all the things people fear in [Typemock Isolator](http://www.typemock.com/):It seems that  [Moq now allows mocking protected fields](http://www.clariusconsulting.net/blogs/kzu/archive/2008/07/05/MockingprotectedmemberswithMoq.aspx).

What's really interesting is that Daniel has chosen to actively allow this, and _hide_ the feature at the same time, as well as put it under a strict _optional request_:

you have to opt in for each code file where you'd like this ability by adding a special imports statement.

So, the questions I have are:

- What happened to "if it's not testable it's a design smell"? Is this a compromise or have people figured out that good design can take many forms, with tools being left to do the hard lifting?
- If you're going to add powerful "non classic" mocking ability to a framework, does adding it as a special "opt-in" feature make it OK? (this is what we are talking about doing with Typemock Isolator)
- If tomorrow Rhino.Mocks were to add the same feature or something even more powerful (statics?) how would people treat that?

## More in Agile

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

- Jul 10, 2008

    ### [Poll: What threading features do you use?](https://osherove.com/blog/2008/7/10/poll-what-threading-features-do-you-use.html)

- Jul 8, 2008

    ### [A sneak Preview of Typemock Racer : Thread Deadlock Finder](https://osherove.com/blog/2008/7/8/a-sneak-preview-of-typemock-racer-thread-deadlock-finder.html)

- Jul 5, 2008

    ### [Extending Depender with your own custom dependency rules](https://osherove.com/blog/2008/7/5/extending-depender-with-your-own-custom-dependency-rules.html)

- Jul 5, 2008

    ### [Introducing Depender - Testability Problem Finder](https://osherove.com/blog/2008/7/5/introducing-depender-testability-problem-finder.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/
