See the version list below for details.
dotnet add package TransparentMoq --version 184.108.40.206
NuGet\Install-Package TransparentMoq -Version 220.127.116.11
<PackageReference Include="TransparentMoq" Version="18.104.22.168" />
paket add TransparentMoq --version 22.214.171.124
#r "nuget: TransparentMoq, 126.96.36.199"
// Install TransparentMoq as a Cake Addin #addin nuget:?package=TransparentMoq&version=188.8.131.52 // Install TransparentMoq as a Cake Tool #tool nuget:?package=TransparentMoq&version=184.108.40.206
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.
private Mock<IFileSystem> fileSystem = new Mock<IFileSystem>();
private IFileSystem fileSystem = New.Mock<IFileSystem>();
To arrange a mock everything remains the same:
fileSystem.Setup(x => x.Exists(It.IsAny<string>())).Returns(true);
|Product||Versions 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.|
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
4.18.2 - https://github.com/moq/moq4/releases/tag/v4.18.2
4.16.0 - https://github.com/moq/moq4/releases/tag/v4.16.0
4.15.2 - https://github.com/moq/moq4/releases/tag/v4.15.2
1.0 - Initial release