Merge branch 'master' into Interfaceinterface

This commit is contained in:
Jordan Brown
2017-11-06 12:52:44 -05:00
committed by GitHub
2 changed files with 31 additions and 5 deletions
+2 -2
View File
@@ -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>
+29 -3
View File
@@ -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);
}
}
}