Fix tests.
This commit is contained in:
@@ -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<bool> func, int maxTicks = 600, int tickStep = 1)
|
||||
protected async Task WaitUntil(IntegrationInstance instance, Func<bool> 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
|
||||
/// <summary>
|
||||
/// Runs <paramref name="ticks"/> ticks on both server and client while keeping their main loop in sync.
|
||||
/// </summary>
|
||||
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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user