LabTesting 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LabTesting --version 0.1.0
                    
NuGet\Install-Package LabTesting -Version 0.1.0
                    
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="LabTesting" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LabTesting" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LabTesting" />
                    
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 LabTesting --version 0.1.0
                    
#r "nuget: LabTesting, 0.1.0"
                    
#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 LabTesting@0.1.0
                    
#: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=LabTesting&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LabTesting&version=0.1.0
                    
Install as a Cake Tool

LabTesting

Un seul package pour tester un plugin LabAPI dans un vrai serveur SCP:SL sous Windows et Linux. Il contient le harnais net48, Harmony 2.3.6, le runner portable .NET 10 et les cibles MSBuild. Installer le SDK .NET 10 et le serveur dédié SteamCMD 996560 séparément.

Dans le projet de tests net48 :

<PackageReference Include="LabTesting" Version="0.1.0" PrivateAssets="all" />

Utiliser la version publiée choisie. La restauration NuGet installe tout le framework et garde harnais/runner à la même version. Aucun EXE à copier, aucun dotnet-tools.json à maintenir.

Placer labtesting.json à la racine du dépôt (ou près du projet de tests) :

{
  "server": ".server",
  "plugins": ["src/MonPlugin/bin/Release/net48/MonPlugin.dll"],
  "dependencies": [],
  "reports": "TestResults",
  "work": ".labtest-work",
  "port": 7799
}

Le package fournit automatiquement le harnais, Harmony et l'assembly du projet de tests. Ne pas les redéclarer dans le JSON. Les plugins requis et leurs autres dépendances restent explicites. Les chemins JSON sont relatifs au fichier JSON.

dotnet build tests/MonPlugin.Tests -c Release
dotnet build tests/MonPlugin.Tests -c Release -t:LabTestingList
dotnet build tests/MonPlugin.Tests -c Release -t:LabTesting

Le build normal restaure et compile ; les tests serveur ne se lancent que sur demande. Pour les lancer après chaque build, ajouter <LabTestingRunOnBuild>true</LabTestingRunOnBuild> au projet de tests.

Propriétés optionnelles : LabTestingConfig (relatif au projet), LabTestingServer, LabTestingReports, LabTestingWork, LabTestingPort, LabTestingTimeout. LabTestingFailOnSkipped vaut true par défaut. Les paramètres de chemin CLI/MSBuild sont relatifs au projet de tests ; privilégier les chemins absolus en CI.

Les assertions et attributs sont dans le namespace LabTesting. Les fixtures peuvent implémenter IAsyncLifetime pour restaurer leur état statique. Les rapports JSONL, JUnit, Markdown et les logs restent disponibles après un échec. Une suite vide ou un verdict incomplet fait échouer le build.

Le package n'inclut aucune assembly du jeu, Unity ou LabAPI. Ajouter les références du plugin et du serveur correspondant aux types utilisés par les tests. PrivateAssets="all" évite de propager ce framework de tests dans vos packages.

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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.3.0 25 9/16/2026
0.2.0 50 9/15/2026
0.1.0 40 9/15/2026