MockableStaticGenerator 0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package MockableStaticGenerator --version 0.0.4
                    
NuGet\Install-Package MockableStaticGenerator -Version 0.0.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="MockableStaticGenerator" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MockableStaticGenerator" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="MockableStaticGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MockableStaticGenerator --version 0.0.4
                    
#r "nuget: MockableStaticGenerator, 0.0.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.
#:package MockableStaticGenerator@0.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MockableStaticGenerator&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=MockableStaticGenerator&version=0.0.4
                    
Install as a Cake Tool
// For whole classes of an external assembly with a lot of static methods, like Dapper.
[MockableStatic(typeof(Dapper.DynamicParameters))]
public class StudentRepositoryTest
{
    [Fact]
    public void StudentRepositoryMoqObject()
    {
        // Dapper.MockableGenerated.ISqlMapperWrapper

        var mockConn = new Mock<IDbConnection>();
        var sut = new StudentRepository(mockConn.Object);
        var stu = sut.GetStudents();

    }
}

// For your class with some static methods.
[MockableStatic]
public class Math
{
    public static int Add(int a, int b) { return a+b; }
    public static int Sub(int a, int b) { return a+b; }
}

For more information read this article.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

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
0.0.5 1,387 9/20/2022
0.0.4 882 12/7/2020