awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
devlooped avatar

devlooped/moq

0
View on GitHub↗
6,389 stars·834 forks·C#·18 views

Moq

Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is to isolate code from external dependencies during unit testing by providing a system for interface simulation and behavioral testing.

The framework distinguishes itself through the use of functional specification queries and LINQ-based querying to create declarative mocks. It supports the simulation of complex scenarios, including the automatic generation of recursive mock hierarchies, the implementation of multiple interfaces within a single mock instance, and the ability to mock protected virtual members.

The library covers broad capability areas including behavioral verification to confirm method invocation frequency and call sequences, and method behavior configuration for defining return values, exceptions, and parameter modifiers. It also provides tools for event simulation and the control of mock strictness to determine how unconfigured members respond.

Features

  • .NET Testing Ecosystem - Provides a comprehensive mocking framework for isolating dependencies within the .NET runtime environment.
  • Dynamic Mock Objects - Generates runtime proxy objects to simulate interfaces and classes, isolating the system from external dependencies.
  • Return Value Configurations - Provides capabilities to define return values and exceptions for simulated methods, including support for asynchronous tasks.
  • Expression-Based Mock Setup - Uses functional expressions and LINQ to declaratively find or create simulated objects with specific behaviors.
  • Behavior Verification - Validates that specific methods were called with the correct arguments and in the expected order.
  • Behavioral Verification Tools - Verifies that specific method invocations and event triggers occur in a precise, predefined order.
  • C# Mocking Libraries - Provides a comprehensive toolset for defining method behaviors and call expectations within C# test suites.
  • Method Invocation Verifications - Confirms that specific methods were called a certain number of times or not at all.
  • Dependency Mocking - Simulates external system behavior by substituting real components with controlled mock implementations.
  • Mock Proxy Generation - Creates simulated object implementations at runtime by generating a proxy class that intercepts calls to virtual members.
  • Accessor Stubbing - Provides control over property getter return values and verification of setter invocations.
  • Multiple Interface Implementations - Enables a single mock instance to implement and provide behavior for several different interfaces simultaneously.
  • Setup Expression Trees - Uses expression trees to extract method signatures and argument constraints for behavioral setup.
  • Multi-Interface Mock Generators - Generates mock implementations of multiple interfaces with customizable return values and exceptions.
  • Argument Constraint Matchers - Evaluates method arguments against constants or custom predicates to trigger specific simulated behaviors.
  • Mock Argument Matchers - Filters method calls using constants, regular expressions, or custom predicates to trigger specific setups.
  • Mock Default Behavior Configurations - Allows configuring fallback responses or exceptions for unexpected method calls to enforce strict behavior.
  • Mock Event Triggering - Allows manually or automatically firing events on a mock object to simulate notifications.
  • Method Argument & Return Manipulation - Executes custom logic before or after a mocked method returns to capture arguments or modify state.
  • Mock Call Order Verifications - Verifies that mock method invocations occur in a predefined sequence across one or more mock objects.
  • Event-Driven Testing Frameworks - Simulates asynchronous event triggers and custom data payloads to verify event-based logic.
  • Call-Stack Interceptors - Captures method invocations and arguments to verify call counts and sequence order against predefined expectations.
  • Declarative Mock Specifications - Supports building stubbed objects and hierarchies using functional specification queries instead of manual setup.
  • Recursive Mock Generation - Automatically instantiates new mock objects when a member return value is another mockable type.
  • Protected Method Mocks - Enables defining behaviors and expectations for protected virtual members using identifiers or proxies.
  • Testing Frameworks - Popular library for mocking interfaces and classes in tests.

Star history

Star history chart for devlooped/moqStar history chart for devlooped/moq

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does devlooped/moq do?

Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is to isolate code from external dependencies during unit testing by providing a system for interface simulation and behavioral testing.

What are the main features of devlooped/moq?

The main features of devlooped/moq are: .NET Testing Ecosystem, Dynamic Mock Objects, Return Value Configurations, Expression-Based Mock Setup, Behavior Verification, Behavioral Verification Tools, C# Mocking Libraries, Method Invocation Verifications.

What are some open-source alternatives to devlooped/moq?

Open-source alternatives to devlooped/moq include: mockk/mockk — MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support… moq/moq4 — Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It… golang/mock — GoMock is a mocking framework for the Go programming language. sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… mockery/mockery — Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing.… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source…

Open-source alternatives to Moq

Similar open-source projects, ranked by how many features they share with Moq.
  • mockk/mockkmockk avatar

    mockk/mockk

    5,747View on GitHub↗

    MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support for final classes, static methods, and coroutines. It functions as a bytecode instrumentation library that modifies compiled class files at load time to intercept constructors, final methods, and static functions without source changes, and also provides dedicated libraries for constructor mocking and coroutine mocking. The framework is designed specifically for Kotlin, handling Kotlin-specific constructs like extension functions, singletons, and suspend functions. MockK disting

    Kotlinargument-matcherschain-callshacktoberfest
    View on GitHub↗5,747
  • moq/moq4Moq avatar

    Moq/moq4

    6,387View on GitHub↗

    Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It serves as a test double generator and behavior verification tool, allowing developers to isolate code during unit testing by replacing real dependencies with programmed mocks. The framework enables the definition of expected method behaviors and return values to control the execution flow of tests. It provides specialized capabilities for simulating methods that use output or reference parameters and mechanisms to monitor and trigger events on simulated objects. The library includ

    C#
    View on GitHub↗6,387
  • golang/mockgolang avatar

    golang/mock

    9,361View on GitHub↗

    GoMock is a mocking framework for the Go programming language.

    Go
    View on GitHub↗9,361
  • sinonjs/sinonsinonjs avatar

    sinonjs/sinon

    9,753View on GitHub↗

    Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes. The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between tes

    JavaScript
    View on GitHub↗9,753
  • See all 30 alternatives to Moq→