mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests. Tests are now split into separate projects as appropriate, and the API side has also been split off.
29 lines
819 B
C#
29 lines
819 B
C#
using NUnit.Framework;
|
|
using Robust.Packaging.AssetProcessing;
|
|
|
|
namespace Robust.Packaging.Tests;
|
|
|
|
/// <summary>
|
|
/// Helper class for testing <see cref="AssetPass"/>.
|
|
/// </summary>
|
|
public static class AssetPassTest
|
|
{
|
|
/// <summary>
|
|
/// Make an asset pass write into a <see cref="AssetPassTestCollector"/> and resolve the graph.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The resolved graph logs to the NUnit test context.
|
|
/// </remarks>
|
|
public static AssetPassTestCollector SetupTestPass(AssetPass testedPass)
|
|
{
|
|
var logger = new PackageLoggerNUnit(TestContext.Out);
|
|
var collectorPass = new AssetPassTestCollector();
|
|
|
|
collectorPass.AddDependency(testedPass);
|
|
|
|
AssetGraph.CalculateGraph([testedPass, collectorPass], logger);
|
|
|
|
return collectorPass;
|
|
}
|
|
}
|