Files
RobustToolbox/Robust.UnitTesting/Packaging/AssetPassTest.cs
T
PJB3005 d1c6c11755 Add asset pass to merge text files in directories.
This massively reduces the file count of published SS14 builds by a few thousand, by combining YAML prototypes and Fluent files in the same folder into one file.
2025-07-25 15:57:18 +02:00

29 lines
825 B
C#

using NUnit.Framework;
using Robust.Packaging.AssetProcessing;
namespace Robust.UnitTesting.Packaging;
/// <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;
}
}