Skip to content

Keboo/TUnit.AutoMocker.Example

Repository files navigation

NuGet package template

This template creates a solution for producing a NuGet package, along with unit tests.

Template

Create a new app in your current directory by running.

> dotnet new keboo.nuget

Parameters

Default template options

Parameter Description Default
--pipeline CI/CD provider to use. Options: github, azuredevops, none github
--sln Use legacy .sln format instead of .slnx format false
--tests Testing framework to use. Options: xunit, mstest, tunit, none xunit

Example with Azure DevOps:

> dotnet new keboo.nuget --pipeline azuredevops

Example with no CI/CD pipeline:

> dotnet new keboo.nuget --pipeline none

Example with legacy .sln format:

> dotnet new keboo.nuget --sln true

Example with MSTest:

> dotnet new keboo.nuget --tests mstest

Example with no tests:

> dotnet new keboo.nuget --tests none

Updating .NET Version

This template uses a global.json file to specify the required .NET SDK version. To update the .NET SDK version:

  1. Update the global.json file in the solution root
  2. Update the <TargetFramework> in the csproj files.

Key Features

Build Customization

Docs

Centralized Package Management

Docs

NuGet package source mapping

Docs

GitHub Actions / Azure DevOps Pipeline

Build, test, pack, and deploy to NuGet.org included. Use --pipeline parameter to choose between GitHub Actions (default) or Azure DevOps Pipelines.

Solution File Format (slnx)

By default, this template uses the new .slnx (XML-based solution) format introduced in .NET 9. This modern format is more maintainable and easier to version control compared to the legacy .sln format.

Blog: Introducing slnx support in the dotnet CLI
Docs: dotnet sln command

If you need to use the legacy .sln format, use the --sln true parameter when creating the template.

About

Testing out ideas for a source gen version of AutoMocker for TUnit.Mocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages