name: TransparentMoq
description: 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&lt;T&gt; variables, instead a T variable can be used. This also removes the need to pass mocks with &quot;.Object&quot; everywhere as they can be passed directly.

The library provides extension methods for most (if not all) of Moq&#39;s methods, so they can be called directly on the T variable.
Examples:
Instead of
private Mock&lt;IFileSystem&gt; fileSystem = new Mock&lt;IFileSystem&gt;();
Write
private IFileSystem fileSystem = New.Mock&lt;IFileSystem&gt;();

Instead of
MethodThatTakesFileSystem(fileSystem.Object);
write
MethodThatTakesFileSystem(fileSystem);

To arrange a mock everything remains the same:
fileSystem.Setup(x =&gt; x.Exists(It.IsAny&lt;string&gt;())).Returns(true);
license_spdx: MIT
version: 4.18.2+cec0e6e961
spec_version: 1.0
download_url: https://www.nuget.org/api/v2/package/TransparentMoq/4.18.2+cec0e6e961
home_url: https://github.com/sundews/TransparentMoq
news_url: https://libraries.io/nuget/TransparentMoq/versions.atom
date: 2024-03-12
about_resource: NONE
libraries_io_url: https://libraries.io/nuget/TransparentMoq?number=4.18.2%2Bcec0e6e961
vcs_tool: git
vcs_repository: https://github.com/sundews/TransparentMoq
vcs_branch: main
