devlooped/moq

The most popular and friendly mocking framework for .NET

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 9 minutes ago
Added to GitGenius on September 10th, 2026
Created on March 11th, 2012
Open Issues & Pull Requests: 21 (+0)
GitHub issues: Enabled
Number of forks: 834
Total Stargazers: 6,401 (+0)
Total Subscribers: 182 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 280 days
Stale 30+ days: 3
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 1

Top labels

  • stale (59)
  • bug (20)
  • enhancement (16)
  • discussion (9)
  • good first issue (5)
  • question (5)
  • up-for-grabs (4)
  • dynamicproxy (3)

Detailed Description

Moq is a mocking library for .NET that enables developers to create test doubles using LINQ expressions and lambda syntax.

The library solves the problem of complex mock setup by leveraging C# and VB.NET language features to provide a simpler alternative to traditional mocking frameworks. Rather than using the Record/Replay pattern common in other libraries, Moq uses LINQ to Mocks, allowing developers to express mock behavior as query-like expressions. This approach lets you specify that you want a mock whose behavior matches a given expression, making the setup more intuitive and readable. The library supports mocking both interfaces and classes, and its type-safe design means refactoring code is safer since mock definitions are checked at compile time.

Moq is well-suited for developers new to mocking or those dissatisfied with the complexity of existing frameworks. It works particularly well for teams practicing state-based testing and those who value pragmatic, lightweight approaches to test setup. The library is designed to be unobtrusive and straightforward, helping developers avoid common mocking pitfalls without requiring deep knowledge of mocking concepts. Its simple API means even novice users can quickly set up test dependencies, and expectations can be easily moved to fixture setup methods and overridden per test as needed.

The project maintains active engagement with its user base through documentation and examples. The repository includes a quickstart guide and references to detailed blog posts explaining the design philosophy. The codebase demonstrates ongoing refinement of the core LINQ-based approach that distinguishes it from other mocking frameworks.