Surity.CLI 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Surity.CLI --version 1.0.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Surity.CLI --version 1.0.1                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Surity.CLI&version=1.0.1                
nuke :add-package Surity.CLI --version 1.0.1                

Surity

Unit-testing framework for Unity mods.

Writing tests

using Surity;

[TestClass]
public class MyTests
{
	[BeforeAll]
	public void SetUp()
	{
		// Ran before all tests in this class
	}

	[AfterAll]
	public void TearDown()
	{
		// Ran after all tests in this class
	}

	[BeforeEach]
	public void TestSetUp()
	{
		// Ran before each test in this class
	}

	[AfterEach]
	public void TestTearDown()
	{
		// Ran after each test in this class
	}

	[Test]
	public void TestSomething()
	{
		// Throw an error to fail. Use your favourite assertion library.
	}
}

Running tests

Tests must be run inside the game if they depend on the Unity runtime.

If you use the BepInEx modding framework, you can add the Surity.BepInEx NuGet package to your test project. The package contains a BepInEx plugin which makes sure all loaded Surity tests are ran only once. The plugin only runs tests if the game was started with the Surity CLI program.

Refer to Surity.BepInEx.cs on how to invoke the test runner manually. Add the Surity.Core NuGet package to your test project if you don't need Surity.BepInEx.

Using Surity CLI

Run tests with the standalone Surity.exe executable or by installing the dotnet tool:

$ dotnet tool install Surity.CLI
$ dotnet surity <path-to-game-exe> [-- arguments]

The program runs the game in batchmode and listens for test results.

Any arguments after -- are passed to the game. For example in

$ dotnet surity <path-to-game-exe> -- -nolog

the -nolog argument is passed to the game executable.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
2.2.0 267 5/21/2023
2.1.4 141 5/21/2023
2.1.3 210 4/26/2023
2.1.2 202 4/24/2023
2.1.1 185 4/16/2023
2.1.0 167 4/15/2023
2.0.1 265 4/5/2023
2.0.0 238 4/4/2023
1.1.2 227 3/27/2023
1.1.1 266 3/21/2023
1.1.0 225 3/21/2023
1.0.4 248 3/10/2023
1.0.3 225 3/9/2023
1.0.2 288 3/9/2023
1.0.1 214 3/8/2023
1.0.0 296 3/6/2023