awesome-repositories.com
Blog
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
devlooped avatar

devlooped/moq

0
View on GitHub↗
6,389 Stars·834 Forks·C#·6 Aufrufe

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.
  • Test-Frameworks - Popular library for mocking interfaces and classes in tests.

Star-Verlauf

Star-Verlauf für devlooped/moqStar-Verlauf für devlooped/moq

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Häufig gestellte Fragen

Was macht devlooped/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.

Was sind die Hauptfunktionen von devlooped/moq?

Die Hauptfunktionen von devlooped/moq sind: .NET Testing Ecosystem, Dynamic Mock Objects, Return Value Configurations, Expression-Based Mock Setup, Behavior Verification, Behavioral Verification Tools, C# Mocking Libraries, Method Invocation Verifications.

Welche Open-Source-Alternativen gibt es zu devlooped/moq?

Open-Source-Alternativen zu devlooped/moq sind unter anderem: 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-Alternativen zu Moq

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Moq.
  • mockk/mockkAvatar von mockk

    mockk/mockk

    5,747Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗5,747
  • moq/moq4Avatar von Moq

    Moq/moq4

    6,387Auf GitHub ansehen↗

    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#
    Auf GitHub ansehen↗6,387
  • golang/mockAvatar von golang

    golang/mock

    9,361Auf GitHub ansehen↗

    GoMock is a mocking framework for the Go programming language.

    Go
    Auf GitHub ansehen↗9,361
  • sinonjs/sinonAvatar von sinonjs

    sinonjs/sinon

    9,753Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗9,753
Alle 30 Alternativen zu Moq anzeigen→