mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 23:02:34 +02:00
RobustToolbox projects should be named Robust.* This PR changes the RobustToolbox projects from SS14.* to Robust.* Updates SS14.* prefixes/namespaces to Robust.* Updates SpaceStation14.sln to RobustToolbox.sln Updates MSBUILD/SS14.* to MSBUILD/Robust.* Updates CSProject and MSBuild references for the above Updates git_helper.py Removes Runserver and Runclient as they are unusable
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System.IO;
|
|
using NUnit.Framework;
|
|
using Robust.Shared.Interfaces.Resources;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.UnitTesting.Shared.ContentPack
|
|
{
|
|
[TestFixture]
|
|
public class ResourceManagerTest : RobustUnitTest
|
|
{
|
|
private static readonly byte[] Data =
|
|
{
|
|
0x56, 0x75, 0x6c, 0x6b, 0x61, 0x6e, 0x20, 0x57, 0x68, 0x65, 0x6e
|
|
};
|
|
|
|
[OneTimeSetUp]
|
|
public void Setup()
|
|
{
|
|
var stream = new MemoryStream(Data);
|
|
var resourceManager = IoCManager.Resolve<IResourceManagerInternal>();
|
|
resourceManager.MountStreamAt(stream, new ResourcePath("/a/b/c.dat"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestMountedStreamRead()
|
|
{
|
|
var resourceManager = IoCManager.Resolve<IResourceManagerInternal>();
|
|
using (var stream = resourceManager.ContentFileRead("/a/b/c.dat"))
|
|
{
|
|
Assert.That(stream.ToArray(), Is.EqualTo(Data));
|
|
}
|
|
}
|
|
}
|
|
}
|