public void ManualSpawnTest() { bool invokeAddPlayerMessage = false; server.LocalPlayer.RegisterHandler <AddCharacterMessage>(msg => invokeAddPlayerMessage = true); spawner.RequestServerSpawnPlayer(); Assert.That(invokeAddPlayerMessage, Is.False); }
public IEnumerator ManualSpawnTest() => UniTask.ToCoroutine(async() => { var invokeAddPlayerMessage = false; ServerMessageHandler.RegisterHandler <AddCharacterMessage>(msg => invokeAddPlayerMessage = true); spawner.RequestServerSpawnPlayer(); // wait for messages to be processed await UniTask.Yield(); Assert.That(invokeAddPlayerMessage, Is.True); });