2019-05-03 13:34:49 +02:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Robust.Shared.Exceptions;
|
|
|
|
|
|
2020-01-20 22:14:44 +01:00
|
|
|
namespace Content.IntegrationTests.Tests
|
2019-05-03 13:34:49 +02:00
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class StartTest : ContentIntegrationTest
|
2019-05-03 13:34:49 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Test that the server starts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task TestServerStart()
|
|
|
|
|
{
|
2021-11-06 11:49:59 +01:00
|
|
|
var server = StartServer(new ServerContentIntegrationOption
|
|
|
|
|
{
|
|
|
|
|
Pool = false
|
|
|
|
|
});
|
2019-05-03 13:34:49 +02:00
|
|
|
server.RunTicks(5);
|
|
|
|
|
await server.WaitIdleAsync();
|
|
|
|
|
Assert.That(server.IsAlive);
|
|
|
|
|
var runtimeLog = server.ResolveDependency<IRuntimeLog>();
|
|
|
|
|
Assert.That(runtimeLog.ExceptionCount, Is.EqualTo(0), "No exceptions must be logged.");
|
|
|
|
|
server.Stop();
|
|
|
|
|
await server.WaitIdleAsync();
|
|
|
|
|
Assert.That(!server.IsAlive);
|
2019-06-04 19:08:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Test that the client starts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task TestClientStart()
|
|
|
|
|
{
|
2021-11-06 11:49:59 +01:00
|
|
|
var client = StartClient(new ClientContentIntegrationOption
|
|
|
|
|
{
|
|
|
|
|
Pool = false
|
|
|
|
|
});
|
2019-06-04 19:08:15 +02:00
|
|
|
await client.WaitIdleAsync();
|
|
|
|
|
Assert.That(client.IsAlive);
|
|
|
|
|
client.RunTicks(5);
|
|
|
|
|
await client.WaitIdleAsync();
|
|
|
|
|
Assert.That(client.IsAlive);
|
|
|
|
|
var runtimeLog = client.ResolveDependency<IRuntimeLog>();
|
|
|
|
|
Assert.That(runtimeLog.ExceptionCount, Is.EqualTo(0), "No exceptions must be logged.");
|
|
|
|
|
client.Stop();
|
|
|
|
|
await client.WaitIdleAsync();
|
|
|
|
|
Assert.That(!client.IsAlive);
|
2019-05-03 13:34:49 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|