From 310786a28af75f7277a1d4c9f235af29a9d7f699 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 5 Oct 2022 18:24:44 +1000 Subject: [PATCH] Add extra comments to group tests --- TShockLauncher.Tests/GroupTests.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/TShockLauncher.Tests/GroupTests.cs b/TShockLauncher.Tests/GroupTests.cs index 7587db3c..61a70b33 100644 --- a/TShockLauncher.Tests/GroupTests.cs +++ b/TShockLauncher.Tests/GroupTests.cs @@ -8,16 +8,19 @@ namespace TShockLauncher.Tests; public class GroupTests { + /// + /// This will be called automatically by nunit before other tests in this class. + /// It serves to initialise the bare minimum variables needed for TShock to be testable without booting up an actual server. + /// [SetUp] public static void SetupTShock() { - Program.SavePath = ""; // 1.4.4.2 - LanguageManager.Instance.SetLanguage(GameCulture.DefaultCulture); - Lang.InitializeLegacyLocalization(); + Program.SavePath = ""; // 1.4.4.2 staticness introduced this where by default it is null, and any touch to Terraria.Main will use it and cause a crash. + LanguageManager.Instance.SetLanguage(GameCulture.DefaultCulture); // TShockAPI.Localization will fail without ActiveCulture set + Lang.InitializeLegacyLocalization(); // TShockAPI.Localization will fail without preparing NPC names etc - //Setup(); var ts = new TShock(null); // prepares configs etc - ts.Initialize(); + ts.Initialize(); // used to prepare tshocks own static variables, such as the TShock.DB instance } ///