Files
tbd-station-14/Content.IntegrationTests/Tests/StartTest.cs
wrexbe 81e3b2da88 Make tests faster (#8737)
* Test changes

* Make finding the test tile a little smarter
2022-06-19 20:22:28 -07:00

37 lines
1.3 KiB
C#

using System.Threading.Tasks;
using NUnit.Framework;
using Robust.Shared.Exceptions;
namespace Content.IntegrationTests.Tests
{
[TestFixture]
public sealed class StartTest
{
/// <summary>
/// Test that the server, and client start, and stop.
/// </summary>
[Test]
public async Task TestClientStart()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{Disconnected = true});
var client = pairTracker.Pair.Client;
Assert.That(client.IsAlive);
await client.WaitRunTicks(5);
Assert.That(client.IsAlive);
var cRuntimeLog = client.ResolveDependency<IRuntimeLog>();
Assert.That(cRuntimeLog.ExceptionCount, Is.EqualTo(0), "No exceptions must be logged on client.");
await client.WaitIdleAsync();
Assert.That(client.IsAlive);
var server = pairTracker.Pair.Server;
Assert.That(server.IsAlive);
var sRuntimeLog = server.ResolveDependency<IRuntimeLog>();
Assert.That(sRuntimeLog.ExceptionCount, Is.EqualTo(0), "No exceptions must be logged on server.");
await server.WaitIdleAsync();
Assert.That(server.IsAlive);
await pairTracker.CleanReturnAsync();
}
}
}