Alchemist

Generate a dedicated UnitTests project with placeholder unit tests for a C# solution with one command.

Alchemist is for .NET developers who want a fast and consistent starting point for test coverage without handwriting each test class, method and attribute from scratch.

Install

Install as a global .NET tool.

dotnet tool install --global KuBuCo.Alchemist

The published tool now targets .NET 8 to reduce install friction on real user machines. The solution you run it against can still target newer SDKs, but that solution must have the SDKs it needs on the machine where generation runs.

Install into a local tool manifest.

dotnet new tool-manifest
dotnet tool install KuBuCo.Alchemist

Then run it with

alchemist --help

Use alchemist-demo to familiarise yourself with Alchemist.

Quick Start

Run Alchemist against a C# solution.

alchemist --solution ./mysolution.sln

Pick a different test framework when needed.

alchemist --solution ./mysolution.sln --framework nunit

Choose how reruns should behave.

alchemist --solution ./mysolution.sln --regeneration.mode update

Example

Source Code

namespace example;

public sealed class Calculator
{
    public int Add(int left, int right)
    {
        return left + right;
    }
}

Command:

alchemist --solution ./example.sln

Result

Example Output

using Xunit;

namespace UnitTests.Example;

public class CalculatorUnitTests
{
    // [UnitTestID=6A1B2C3D4E5F6789]
    [Fact(Skip = "Unit test not implemented.")]
    public void Add_UnitTestPlaceholder()
    {
        Assert.True(false, "Scaffolded Unit Test");
    }
}

Supported Scenarios

Alchemist Supports

What it Generates

Regeneration Behavior

Limitations