Files
RobustToolbox/Robust.Packaging.Tests/AssetPassTest.cs
PJB3005 788e9386fd Split up test project
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.
2025-12-16 01:36:53 +01:00

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;
}
}