Files
tbd-station-14/Content.IntegrationTests/StartTest.cs
ZelteHonor b2e2aef78d Rider static analysis (#433)
* Non-accessed local variable

* Merge cast and type checks.

* StringComparison.Ordinal added for better culture support

* Supposed code improvement in launcher. Remove unused code.

* Update ExplosionHelper.cs

Unintentional change.

* Optimized Import

* Add Robust.Shared.Utility import where it was deleted

* Other random suggestion

* Improve my comment
2019-11-13 23:37:46 +01:00

47 lines
1.5 KiB
C#

using System.Threading.Tasks;
using NUnit.Framework;
using Robust.Shared.Exceptions;
namespace Content.IntegrationTests
{
[TestFixture]
public class StartTest : ContentIntegrationTest
{
/// <summary>
/// Test that the server starts.
/// </summary>
[Test]
public async Task TestServerStart()
{
var server = StartServer();
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);
}
/// <summary>
/// Test that the client starts.
/// </summary>
[Test]
public async Task TestClientStart()
{
var client = StartClient();
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);
}
}
}