A BRIEF LOOK AT MOQ

.NET has many mocking frameworks. For years Rhino Mocks was the mocking framework for .NET, and many applications used it extensively in test suites. In addition to Rhino Mocks, other mocking frameworks such as NUnit Mocks, TypeMock, and Easy Mock have gained popularity. They are all good frameworks and offer various features that may make them more or less appealing to various developers and development teams. Some developers still prefer to hand-roll their own mocks, but this is becoming less frequent as mocking frameworks have become more widespread, full-featured, and easy to use. A mocking framework is definitely preferable to rolling your own mocks, and it can make your TDD experience more efficient and fulfilling. Moq is quickly becoming one of the most popular mocking frameworks for .NET. It has a solid list of features, is easy to use, and has a large community support base, which ensures constant improvement and development of Moq's features.

What Does a Mocking Framework Do?

A mocking framework gives you the facilities to quickly create and consume stubs and mocks. Using a mocking frameworks API, you can create your mocks and inject your own testing functionality at runtime. Mocking frameworks also give you a Domain-Specific Language (DSL) for defining execution rules for your mocked resources.

A Bit About Moq

Moq is an open-source .NET mocking framework that is published under the BSD license. Moq was built to take advantage of new language features ...

Get Professional Test-Driven Development with C#: Developing Real World Applications with TDD now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.