moq icon
moq icon

moq

 1 like

Moq is the only mocking library for .NET developed from scratch to take full advantage of .NET Linq expression trees and lambda expressions, which makes it the most productive, type-safe and refactoring-friendly mocking library available.

Cost / License

  • Free
  • Open Source

Since

  • Since 2023

Updated

  • Updated Nov 2026

Releases

  • 1 release last year1 last year

Platforms

  • Windows
  • .NET Framework
  • Microsoft Visual Studio
Save

Features

Properties

Features

Highlights All activities

moq News & Activities

Recent News

Recent activities

No activities found.

moq information

AlternativeTo Category

Development

GitHub repository

  •  6,409 Stars
  •  830 Forks
  •  7 Open Issues
  •   Updated  
View on GitHub

Our users have written 1 comment or review about moq, and it has gotten 1 like.

moq was added to AlternativeTo by Danilo Venom on and this page was last updated .

Comments and Reviews

   
0

Official Links

What is moq?

Moq is the only mocking library for .NET developed from scratch to take full advantage of .NET Linq expression trees and lambda expressions, which makes it the most productive, type-safe and refactoring-friendly mocking library available. And it supports mocking interfaces as well as classes. Its API is extremely simple and straightforward, and doesn't require any prior knowledge or experience with mocking concepts.

Moq offers the following features:

  • Strong-typed: no strings for expectations, no object-typed return values or constraints
  • Unsurpassed VS IntelliSense integration: everything supports full VS IntelliSense, from setting expectations, to - specifying method call arguments, return values, etc.
  • No Record/Replay idioms to learn. Just construct your mock, set it up, use it and optionally verify calls to it (you may not verify mocks when they act as stubs only, or when you are doing more classic state-based testing by checking returned values from the object under test)
  • VERY low learning curve as a consequence of the previous three points. For the most part, you don't even need to ever read the documentation.
  • Granular control over mock behavior with a simple MockBehavior enumeration (no need to learn what's the theoretical difference between a mock, a stub, a fake, a dynamic mock, etc.)
  • Mock both interfaces and classes
  • Override expectations: can set default expectations in a fixture setup, and override as needed on tests
  • Pass constructor arguments for mocked classes
  • Intercept and raise events on mocks
  • Intuitive support for out/ref arguments