From 06d28f04e699cc876ae233a05dfbab05ee145a26 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:07:07 +1000 Subject: [PATCH] Add ExecuteCommand() (#4466) --- Robust.UnitTesting/RobustIntegrationTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Robust.UnitTesting/RobustIntegrationTest.cs b/Robust.UnitTesting/RobustIntegrationTest.cs index b059c1829..445affd1b 100644 --- a/Robust.UnitTesting/RobustIntegrationTest.cs +++ b/Robust.UnitTesting/RobustIntegrationTest.cs @@ -22,6 +22,7 @@ using Robust.Server.ServerStatus; using Robust.Shared; using Robust.Shared.Asynchronous; using Robust.Shared.Configuration; +using Robust.Shared.Console; using Robust.Shared.ContentPack; using Robust.Shared.GameObjects; using Robust.Shared.Input; @@ -269,6 +270,7 @@ namespace Robust.UnitTesting public ISharedPlayerManager PlayerMan { get; private set; } = default!; public IGameTiming Timing { get; private set; } = default!; public IMapManager MapMan { get; private set; } = default!; + public IConsoleHost ConsoleHost { get; private set; } = default!; protected virtual void ResolveIoC(IDependencyCollection deps) { @@ -278,6 +280,7 @@ namespace Robust.UnitTesting PlayerMan = deps.Resolve(); Timing = deps.Resolve(); MapMan = deps.Resolve(); + ConsoleHost = deps.Resolve(); } public T System() where T : IEntitySystem @@ -295,6 +298,11 @@ namespace Robust.UnitTesting return EntMan.GetComponent(uid); } + public async Task ExecuteCommand(string cmd) + { + await WaitPost(() => ConsoleHost.ExecuteCommand(cmd)); + } + /// /// Whether the instance is still alive. /// "Alive" indicates that it is able to receive and process commands.