Skip to content

mrviduus/ConsoleWithTests.Template

Console App with xUnit v3 Tests Template

NuGet Version NuGet Downloads License CI/CD .NET

A production-ready .NET template that creates a console application with xUnit v3 test project structure, following best practices and clean architecture.

Features

  • ✅ Console application with sample code
  • ✅ xUnit v3 test project with examples
  • ✅ Solution file linking both projects
  • ✅ Microsoft Testing Platform integration
  • ✅ Sample tests demonstrating Fact and Theory patterns
  • ✅ Support for .NET 10 (default), .NET 9, and .NET 8

Installation

dotnet new install console-with-tests

Usage

Create a New Project

dotnet new console-with-tests -n MyProject

This creates:

MyProject/
  MyProject.sln                 # Solution file
  src/
    App/
      App.csproj               # Console application
      Program.cs               # Main program with sample Add method
  tests/
    App.Tests/
      App.Tests.csproj         # xUnit v3 test project
      UnitTest1.cs             # Sample unit tests
      xunit.runner.json        # xUnit configuration

Framework Options

# .NET 10 (default)
dotnet new console-with-tests -n MyProject

# .NET 9
dotnet new console-with-tests -n MyProject --Framework net9.0

# .NET 8
dotnet new console-with-tests -n MyProject --Framework net8.0

Build and Test

cd MyProject
dotnet build
dotnet test

Requirements

  • .NET SDK 8.0 or later
  • .NET 10.0 SDK for net10.0 projects (default)

Contributing

We welcome contributions! See CONTRIBUTING.md for details.

Security

Found a security issue? See SECURITY.md for reporting procedures.

License

MIT License - see LICENSE for details.

Support


Made with ❤️ for the .NET Community
Star ⭐ this repository if you find it helpful!

About

A .NET template for creating console applications with xUnit v3 tests

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors