mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 22:48:20 +01:00
Merge branch 'master' into Interfaceinterface
This commit is contained in:
@@ -214,8 +214,6 @@ namespace TGServerService
|
||||
{
|
||||
var newVersion = Config.SettingsVersion;
|
||||
Config.Upgrade();
|
||||
|
||||
PrePrepConfig();
|
||||
|
||||
for (var oldVersion = Config.SettingsVersion; oldVersion < newVersion; ++oldVersion)
|
||||
MigrateSettings(oldVersion);
|
||||
@@ -225,6 +223,8 @@ namespace TGServerService
|
||||
Config.UpgradeRequired = false;
|
||||
Config.Save();
|
||||
}
|
||||
|
||||
PrePrepConfig();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -19,10 +19,9 @@ namespace TGServerService.Tests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test <see cref="Service.OnStart(string[])"/> and <see cref="Service.OnStop"/> can execute successfully
|
||||
/// Starts and stops a <see cref="Service"/>
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestStartupAndShutdown()
|
||||
void StartStopServiceBasic()
|
||||
{
|
||||
using (var S = new ServiceAccessor())
|
||||
{
|
||||
@@ -30,6 +29,15 @@ namespace TGServerService.Tests
|
||||
S.FakeStop();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test <see cref="Service.OnStart(string[])"/> and <see cref="Service.OnStop"/> can execute successfully
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestStartupAndShutdown()
|
||||
{
|
||||
StartStopServiceBasic();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test <see cref="Service.OnStart(string[])"/> and <see cref="Service.OnStop"/> can execute successfully with a commandline port override
|
||||
@@ -37,11 +45,29 @@ namespace TGServerService.Tests
|
||||
[TestMethod]
|
||||
public void TestCommandLinePortSet()
|
||||
{
|
||||
Properties.Settings.Default.RemoteAccessPort = 11111;
|
||||
using (var S = new ServiceAccessor())
|
||||
{
|
||||
S.FakeStart(new string[] { "-port", "36785" });
|
||||
S.FakeStop();
|
||||
}
|
||||
Assert.AreEqual(Properties.Settings.Default.RemoteAccessPort, 36785);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test that the .NET config is always initialized regardless of <see cref="Properties.Settings.UpgradeRequired"/>
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestNETConfigIsAlwaysPrepped()
|
||||
{
|
||||
Properties.Settings.Default.UpgradeRequired = true;
|
||||
Properties.Settings.Default.InstancePaths = null;
|
||||
StartStopServiceBasic();
|
||||
Assert.IsNotNull(Properties.Settings.Default.InstancePaths);
|
||||
Properties.Settings.Default.UpgradeRequired = false;
|
||||
Properties.Settings.Default.InstancePaths = null;
|
||||
StartStopServiceBasic();
|
||||
Assert.IsNotNull(Properties.Settings.Default.InstancePaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user