Files
RobustToolbox/Robust.UnitTesting/Helpers.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

24 lines
680 B
C#

using System;
using System.IO;
using System.Text;
using Robust.Shared.ContentPack;
namespace Robust.UnitTesting
{
internal static class Helpers
{
public static void MountString(this IResourceManagerInternal resourceManager, string path, string content)
{
if (path.Contains("\n"))
{
throw new ArgumentException("Mount path contains newline. Did you mix up mount path and content?");
}
var stream = new MemoryStream();
stream.Write(Encoding.UTF8.GetBytes(content));
stream.Position = 0;
resourceManager.MountStreamAt(stream, new (path));
}
}
}