mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Removed the Interfaces folder. * All objects inside the GameObjects subfolders are now in the GameObjects namespace. * Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces. * Simplified Robust.client.Graphics namespace. * Automated remove redundant using statements.
25 lines
721 B
C#
25 lines
721 B
C#
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
using Robust.Shared.ContentPack;
|
|
using Robust.Shared.Utility;
|
|
|
|
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 ResourcePath(path));
|
|
}
|
|
}
|
|
}
|