Moq.Analyzers 0.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package Moq.Analyzers --version 0.0.9                
NuGet\Install-Package Moq.Analyzers -Version 0.0.9                
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.Analyzers" Version="0.0.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Moq.Analyzers --version 0.0.9                
#r "nuget: Moq.Analyzers, 0.0.9"                
#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.Analyzers as a Cake Addin
#addin nuget:?package=Moq.Analyzers&version=0.0.9

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

Moq.Analyzers

Visual Studio extension and Roslyn analyzer that helps to write unit tests using Moq mocking library. Port of Resharper extension to Roslyn.

Note: If you are using Visual Studio 2017 then you can additionally install Moq.Autocomplete extension/package to get better autocomplete suggestions when writing code.

Detected issues

  • Moq1000 = Sealed classes cannot be mocked.
  • Moq1001 = Mocked interfaces cannot have constructor parameters.
  • Moq1002 = Parameters provided into mock do not match any existing constructors.
  • Moq1100 = Callback signature must match the signature of the mocked method.
  • Moq1101 = SetupGet/SetupSet should be used for properties, not for methods.
  • Moq1200 = Setup should be used only for overridable members.
  • Moq1201 = Setup of async methods should use .ReturnsAsync instance instead of .Result.
  • Moq1300 = Mock.As() should take interfaces.

TODO

  • Setup() should be used for methods, not for properties
  • AdvancedMatcherAttribute should accept only IMatcher types
  • Checks for protected mocks when dynamically referencing their members
  • Setup() requires overridable members
  • Mock.Get() should not take literals

How to install

  • (Option 1) Install "Moq.Analyzers" NuGet package into test projects. Con: Extension will work for specific projects only. Pro: It will be available for all project developers automatically.
  • (Option 2) Install "Moq.Analyzers" extension into Visual Studio. Con: Every developer must install extension manually. Pro: It works for all your projects.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  net461 was computed.  net462 was computed.  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 tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 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)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Moq.Analyzers:

Package Downloads
Reo.Core.Testing

Package Description

Reo.Core.IntegrationTesting

Package Description

Reo.Core.Testing.31

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Moq.Analyzers:

Repository Stars
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
Richasy/Bili.Copilot
B站第三方 Windows 桌面客户端,使用 Windows App SDK 构建的原生应用
Version Downloads Last updated
0.2.0 5,180 10/20/2024
0.2.0-alpha 66 10/20/2024
0.1.2 39,679 8/28/2024
0.1.1 54,931 6/28/2024
0.1.0 38,650 6/4/2024
0.1.0-beta 90 6/4/2024
0.0.9 765,816 1/11/2022
0.0.8 719,088 8/11/2019
0.0.7 5,246 7/28/2019
0.0.6 1,012 7/28/2019
0.0.4.43043 54,030 11/26/2017
0.0.4.41458 2,835 11/26/2017
0.0.3.40797 2,789 11/26/2017
0.0.1.22865 3,246 11/26/2017