.NET Standard 2.0 .NET Framework 4.6.2
This package has a SemVer 2.0.0 package version:
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TransparentMoq --version
NuGet\Install-Package TransparentMoq -Version
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="TransparentMoq" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TransparentMoq --version
#r "nuget: TransparentMoq,"
#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 TransparentMoq as a Cake Addin
#addin nuget:?package=TransparentMoq&version=

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

With inspiration taken from mocking frameworks like NSubstitute, FakeItEasy and JustMock this package adds some of the syntactic advantages of these frameworks to Moq.

TransparentMoq allows to use Moq without having to store mocks in Mock<T> variables, instead a T variable can be used. This also removes the need to pass mocks with ".Object" everywhere as they can be passed directly.

The library provides extension methods for most (if not all) of Moq's methods, so they can be called directly on the T variable.
Instead of
private Mock<IFileSystem> fileSystem = new Mock<IFileSystem>();
private IFileSystem fileSystem = New.Mock<IFileSystem>();

Instead of

To arrange a mock everything remains the same:
fileSystem.Setup(x => x.Exists(It.IsAny<string>())).Returns(true);

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. 
.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.
  • .NETFramework 4.6.2

    • Moq (>= 4.18.2)
  • .NETStandard 2.0

    • Moq (>= 4.18.2)
  • .NETStandard 2.1

    • Moq (>= 4.18.2)

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated 35 3/20/2023 368 11/28/2022 43 11/28/2022 42 11/28/2022
4.18.1 109 11/28/2022 47 11/28/2022 387 8/21/2022 74 8/21/2022 72 8/21/2022 140 8/5/2022 119 6/23/2022 606 6/23/2022 171 6/19/2022 68 6/19/2022 286 6/19/2021 279 5/3/2021 279 4/24/2021 269 4/7/2021 253 4/7/2021 248 4/6/2021 237 3/29/2021 235 3/29/2021 286 3/5/2021 251 3/4/2021
4.16.1 277 2/1/2021
4.16.0 271 1/24/2021
4.15.2 360 12/6/2020
1.2.1 355 10/29/2020
1.2.0 289 10/28/2020
1.1.0 293 10/28/2020
1.0.0 455 9/27/2020