# devlooped/moq

The most popular and friendly mocking framework for .NET

Repository: https://github.com/devlooped/moq
Canonical: https://ross.abutalabs.com/products/moq
Language: C#
License: NOASSERTION
License Family: other
Last push: 2026-08-21T00:08:39+00:00

## Health v2 (maintenance only)
Score: 78/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 40, longevity 100
- inputs: {"age_days": 5288, "days_push": 13, "days_rel": 726, "gap_med": 3, "n_releases_24m": 2}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6403, forks 836 (observed 2026-08-28T04:09:43.156781+00:00)

## What it is
Moq is the most popular mocking framework for .NET, letting developers create mock objects from interfaces and classes using lambda expressions and LINQ expression trees. It provides a simple, type-safe API for setting up behavior and verifying interactions in unit tests.

## Use cases
- mock interfaces and classes in .NET unit tests
- verify method calls with expected arguments in C# tests
- set up return values for dependencies in TDD
- replace hand-written test fakes with dynamic mocks
- use LINQ expressions to create succinct mock setups

## When to choose
- you're writing unit tests in C# or other .NET languages
- you want a friendly, low-barrier mocking API with strong typing
- you prefer state-based or classic TDD with interaction verification
- you want the de facto standard mocking library for .NET

## When to avoid
- you're not developing on the .NET platform
- you need integration or end-to-end testing rather than unit-test isolation
- you prefer a different mocking style such as NSubstitute or fake providers

## Facets
- artifact type: library
- maturity: active
- function: mocking, testing
- domain: testing, developer-tools
- platform: dotnet, cross-platform
- tags: csharp, unit-testing, tdd, linq-to-mocks, nuget

## Member repositories
- devlooped/moq (main) score 78

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:43.156781+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:44:57.458666+00:00, confidence not recorded.
  - readme: https://github.com/devlooped/moq (fetched 2026-08-28T04:09:43.156781+00:00, sha 1c175dc1090a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
