Fix unit tests

This commit is contained in:
Cyberboss
2018-11-01 11:43:07 -04:00
parent 6545ae76b0
commit 057b217f76
2 changed files with 16 additions and 6 deletions
@@ -43,10 +43,10 @@ namespace Tgstation.Server.Host.Core.Tests
var mockTokenFactory = new Mock<ITokenFactory>();
Assert.ThrowsException<ArgumentNullException>(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, null, null));
var mockGeneralOptions = new Mock<IOptions<GeneralConfiguration>>();
mockGeneralOptions.SetupGet(x => x.Value).Returns(new GeneralConfiguration()).Verifiable();
Assert.ThrowsException<ArgumentNullException>(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockGeneralOptions.Object, null));
mockGeneralOptions.VerifyAll();
var mockControlPanelOptions = new Mock<IOptions<ControlPanelConfiguration>>();
mockControlPanelOptions.SetupGet(x => x.Value).Returns(new ControlPanelConfiguration()).Verifiable();
Assert.ThrowsException<ArgumentNullException>(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockControlPanelOptions.Object, null));
mockControlPanelOptions.VerifyAll();
}
class MockSetupWizard : ISetupWizard
@@ -135,7 +135,6 @@ namespace Tgstation.Server.Host.Core.Tests
"user",
"pass",
//general config
"y",
"four",
"-12",
"16",
@@ -145,6 +144,9 @@ namespace Tgstation.Server.Host.Core.Tests
"fake token",
//logging config
"no",
//cp config
"y",
"y",
//saved, now for second run
//this time use defaults amap
String.Empty,
@@ -166,6 +168,10 @@ namespace Tgstation.Server.Host.Core.Tests
"not actually verified because lol mocks /../!@#$%^&*()/..///.",
"Warning",
String.Empty,
//cp config
"y",
"n",
String.Empty,
//third run, we already hit all the code coverage so just get through it
String.Empty,
nameof(DatabaseType.MariaDB),
@@ -185,7 +191,11 @@ namespace Tgstation.Server.Host.Core.Tests
String.Empty,
"fake",
"None",
"Critical"
"Critical",
//cp config
"y",
"n",
"http://fake.com, https://example.org",
};
var inputPos = 0;