A P P E N D I X C
Mocking with Moq
Moq (pronounced “Mock-you” or just “Mock”): what is it good for? With the evolution of automated testing, new challenges arise and mocking frameworks are one of these new challenges.
While other mocking frameworks exist—such as RhinoMocks (the framework we used in our case study) or TypeMock, to name a couple —Moq is the only mocking library for .NET to take full advantage of the .NET 3.0 and 3.5 Frameworks. Moq relies heavily on LINQ and lambda expressions, and its API is designed for developers new to mocking frameworks. While Moq relies on the .NET 3.0 and 3.5 language features, Moq does require .NET Framework 3.5 or higher.
We will explain why mocking is important and how it can save a developer time. ...