.NET 6.0 .NET Standard 2.0 .NET Framework 4.6.2
dotnet add package Moq --version 4.18.4
NuGet\Install-Package Moq -Version 4.18.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Moq" Version="4.18.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Moq --version 4.18.4
#r "nuget: Moq, 4.18.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Moq as a Cake Addin
#addin nuget:?package=Moq&version=4.18.4

// Install Moq as a Cake Tool
#tool nuget:?package=Moq&version=4.18.4

Moq is the most popular and friendly mocking framework for .NET.

Built from https://github.com/moq/moq4/tree/042a2ebbe

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (728)

Showing the top 5 NuGet packages that depend on Moq:

Package Downloads
AutoFixture.AutoMoq The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

This extension turns AutoFixture into an Auto-Mocking Container. The mock instances are created by Moq. To use it, add the AutoMoqCustomization to your Fixture instance. Read more at http://blog.ploeh.dk/2010/08/19/AutoFixtureAsAnAutomockingContainer.aspx

Moq.AutoMock

An auto-mocking container that generates mocks using Moq

Autofac.Extras.Moq The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Autofac extension for automocking and creation of mock objects in Moq.

MockQueryable.Moq

Extension for mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc. When writing tests for your application it is often desirable to avoid hitting the database. The extension allows you to achieve this by creating a context – with behavior defined by your tests – that makes use of in-memory data.

Moq.EntityFrameworkCore

Library that provides methods that will help you with mocking Entity Framework Core.

GitHub repositories (1.1K)

Showing the top 5 popular GitHub repositories that depend on Moq:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
dotnet-architecture/eShopOnContainers
Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 7, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor.
Wox-launcher/Wox
Launcher for Windows, an alternative to Alfred and Launchy.
jellyfin/jellyfin
The Free Software Media System
AvaloniaUI/Avalonia
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET Foundation community project.
Version Downloads Last updated
4.18.4 14,149,776 12/30/2022
4.18.3 3,324,310 12/5/2022
4.18.2 21,335,283 8/2/2022
4.18.1 16,041,656 5/16/2022
4.18.0 659,944 5/11/2022
4.17.2 15,813,805 3/6/2022
4.17.1 1,574,842 2/26/2022
4.16.1 74,439,348 2/23/2021
4.16.0 13,040,154 1/16/2021
4.15.2 10,500,593 11/26/2020
4.15.1 5,976,195 11/10/2020
4.14.7 6,784,904 10/14/2020
4.14.6 3,076,250 9/30/2020
4.14.5 19,942,942 7/1/2020
4.14.4 1,612,932 6/24/2020
4.14.3 1,394,800 6/18/2020
4.14.2 917,213 6/16/2020
4.14.1 12,024,367 4/28/2020
4.14.0 1,093,556 4/24/2020
4.13.1 41,098,194 10/19/2019
4.13.0 9,491,030 8/31/2019
4.12.0 12,410,472 6/20/2019
4.11.0 4,247,441 5/27/2019
4.11.0-rc2 4,885 5/27/2019
4.11.0-rc1 190,537 4/19/2019
4.10.1 28,446,738 12/3/2018
4.10.0 12,769,047 9/8/2018
4.9.0 8,595,082 7/13/2018
4.8.3 5,035,961 6/9/2018
4.8.2 11,999,172 2/23/2018
4.8.1 4,850,975 1/8/2018
4.8.0 2,810,558 12/24/2017
4.8.0-rc1 48,556 12/8/2017
4.7.145 6,784,062 11/6/2017
4.7.142 2,564,547 10/10/2017
4.7.137 1,295,395 10/3/2017
4.7.127 818,632 9/25/2017
4.7.99 5,944,644 7/17/2017
4.7.63 1,646,105 6/21/2017
4.7.58 71,287 6/20/2017
4.7.49 363,929 6/18/2017
4.7.46 69,412 6/18/2017
4.7.25 1,289,477 6/2/2017
4.7.12 263,195 5/30/2017
4.7.11 5,333 5/30/2017
4.7.10 1,139,385 5/6/2017
4.7.9 407,138 4/29/2017
4.7.8 1,738,315 3/26/2017
4.7.7 26,857 3/25/2017
4.7.1 1,518,698 2/28/2017
4.7.0 8,529,544 2/22/2017
4.6.62-alpha 5,559 2/21/2017
4.6.39-alpha 12,851 2/18/2017
4.6.38-alpha 728,659 8/20/2016
4.6.36-alpha 203,482 7/20/2016
4.6.25-alpha 106,378 6/6/2016
4.5.30 3,605,859 1/9/2017
4.5.29 1,099,286 12/10/2016
4.5.28 1,803,308 11/10/2016
4.5.23 1,112,734 10/11/2016
4.5.22 760,398 9/20/2016
4.5.21 1,501,305 8/12/2016
4.5.20 9,853 8/12/2016
4.5.19 89,413 8/10/2016
4.5.18 6,727 8/10/2016
4.5.16 787,484 7/18/2016
4.5.13 183,896 7/11/2016
4.5.10 644,225 6/21/2016
4.5.9 623,757 6/9/2016
4.5.9-alpha 9,925 5/22/2016
4.5.8 681,417 5/26/2016
4.5.7 8,655 5/26/2016
4.5.7-alpha 3,985 5/22/2016
4.5.6-alpha 4,173 5/22/2016
4.5.3 894,882 5/25/2016
4.5.0 252,707 5/24/2016
4.2.1510.2205 7,445,047 10/22/2015
4.2.1507.118 2,702,434 7/1/2015
4.2.1506.2515 142,695 6/25/2015
4.2.1506.2016 65,535 6/20/2015
4.2.1502.911 2,902,212 2/9/2015
4.2.1409.1722 2,127,527 9/17/2014
4.2.1408.717 874,297 8/7/2014
4.2.1408.619 26,180 8/6/2014
4.2.1402.2112 2,240,550 2/21/2014
4.2.1312.1622 887,697 12/17/2013
4.2.1312.1621 5,883 12/16/2013
4.2.1312.1615 6,477 12/16/2013
4.2.1312.1416 19,584 12/14/2013
4.2.1312.1323 7,052 12/14/2013
4.2.1312.1319 45,485 12/13/2013
4.1.1311.615 363,893 11/18/2013
4.1.1309.1617 613,190 9/16/2013
4.1.1309.919 281,098 9/9/2013
4.1.1309.801 13,336 9/8/2013
4.1.1309.800 6,116 9/8/2013
4.1.1308.2321 865,333 8/23/2013
4.1.1308.2316 8,648 8/23/2013
4.1.1308.2120 1,189,688 8/21/2013
4.0.10827 4,528,760 2/9/2011
3.1.416.3 427,603 2/9/2011