From 38d42768677591675508d2c4c0fb5ae01b65cb72 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 3 Jan 2025 22:03:56 +1000 Subject: [PATCH] Utilize nunit TestContext instead of console --- TerrariaServerAPI.Tests/BaseTest.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TerrariaServerAPI.Tests/BaseTest.cs b/TerrariaServerAPI.Tests/BaseTest.cs index 31b4912b..1f740732 100644 --- a/TerrariaServerAPI.Tests/BaseTest.cs +++ b/TerrariaServerAPI.Tests/BaseTest.cs @@ -12,20 +12,21 @@ public class BaseTest [OneTimeSetUp] public void EnsureInitialised() { + TestContext.Out.WriteLine($"Test architecture {RuntimeInformation.ProcessArchitecture}"); + if (!_initialized) { - var are = new AutoResetEvent(false); + AutoResetEvent are = new(false); Exception? error = null; - HookEvents.HookDelegate cb = (instance, args) => + HookEvents.HookDelegate cb = (instance, args) => { instance.Initialize(); are.Set(); _initialized = true; - Console.WriteLine($"Server init process successful for architecture {RuntimeInformation.ProcessArchitecture}"); }; HookEvents.Terraria.Main.DedServ += cb; - global::TerrariaApi.Server.Program.Main(new string[] { }); + global::TerrariaApi.Server.Program.Main([]); _initialized = are.WaitOne(TimeSpan.FromSeconds(30));