From 14b793b3b517a43da5588ca30f96aceaa6d93cbf Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 24 Nov 2020 02:40:42 +0100 Subject: [PATCH] Fix tests. --- .../ContentIntegrationTest.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Content.IntegrationTests/ContentIntegrationTest.cs b/Content.IntegrationTests/ContentIntegrationTest.cs index cd73571d31..07177639c8 100644 --- a/Content.IntegrationTests/ContentIntegrationTest.cs +++ b/Content.IntegrationTests/ContentIntegrationTest.cs @@ -23,6 +23,7 @@ namespace Content.IntegrationTests protected sealed override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null) { options ??= new ClientIntegrationOptions(); + options.ExtraAssemblies = new[] {typeof(ContentIntegrationTest).Assembly}; // ReSharper disable once RedundantNameQualifier options.ClientContentAssembly = typeof(EntryPoint).Assembly; @@ -53,6 +54,7 @@ namespace Content.IntegrationTests protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null) { options ??= new ServerIntegrationOptions(); + options.ExtraAssemblies = new[] {typeof(ContentIntegrationTest).Assembly}; options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly; options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly; options.BeforeStart += () => @@ -89,7 +91,9 @@ namespace Content.IntegrationTests return StartServer(options); } - protected async Task<(ClientIntegrationInstance client, ServerIntegrationInstance server)> StartConnectedServerClientPair(ClientIntegrationOptions clientOptions = null, ServerIntegrationOptions serverOptions = null) + protected async Task<(ClientIntegrationInstance client, ServerIntegrationInstance server)> + StartConnectedServerClientPair(ClientIntegrationOptions clientOptions = null, + ServerIntegrationOptions serverOptions = null) { var client = StartClient(clientOptions); var server = StartServer(serverOptions); @@ -100,7 +104,9 @@ namespace Content.IntegrationTests } - protected async Task<(ClientIntegrationInstance client, ServerIntegrationInstance server)> StartConnectedServerDummyTickerClientPair(ClientIntegrationOptions clientOptions = null, ServerIntegrationOptions serverOptions = null) + protected async Task<(ClientIntegrationInstance client, ServerIntegrationInstance server)> + StartConnectedServerDummyTickerClientPair(ClientIntegrationOptions clientOptions = null, + ServerIntegrationOptions serverOptions = null) { var client = StartClient(clientOptions); var server = StartServerDummyTicker(serverOptions); @@ -136,7 +142,8 @@ namespace Content.IntegrationTests return grid; } - protected async Task WaitUntil(IntegrationInstance instance, Func func, int maxTicks = 600, int tickStep = 1) + protected async Task WaitUntil(IntegrationInstance instance, Func func, int maxTicks = 600, + int tickStep = 1) { var ticksAwaited = 0; bool passed; @@ -160,7 +167,8 @@ namespace Content.IntegrationTests Assert.That(passed); } - private static async Task StartConnectedPairShared(ClientIntegrationInstance client, ServerIntegrationInstance server) + private static async Task StartConnectedPairShared(ClientIntegrationInstance client, + ServerIntegrationInstance server) { await Task.WhenAll(client.WaitIdleAsync(), server.WaitIdleAsync()); @@ -174,7 +182,8 @@ namespace Content.IntegrationTests /// /// Runs ticks on both server and client while keeping their main loop in sync. /// - protected static async Task RunTicksSync(ClientIntegrationInstance client, ServerIntegrationInstance server, int ticks) + protected static async Task RunTicksSync(ClientIntegrationInstance client, ServerIntegrationInstance server, + int ticks) { for (var i = 0; i < ticks; i++) {