Skip to content

Commit 59463bf

Browse files
committed
Force NetworkSceneManagerEventNotifications to fail to test rerun behaviour
1 parent 96c9611 commit 59463bf

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

testproject/Assets/Tests/Runtime/NetworkSceneManager/NetworkSceneManagerEventNotifications.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ private void ClientSceneManager_OnSceneEvent(SceneEvent sceneEvent)
9494
{
9595
// Validate that the clients finish synchronization and they used the proper synchronization mode
9696
case SceneEventType.SynchronizeComplete:
97-
{
98-
var authority = GetAuthorityNetworkManager();
99-
var matchedClient = m_ClientNetworkManagers.FirstOrDefault(c => c.LocalClientId == sceneEvent.ClientId);
100-
Assert.That(matchedClient, Is.Not.Null, $"Found no client {nameof(NetworkManager)}s that had a {nameof(NetworkManager.LocalClientId)} of {sceneEvent.ClientId}");
101-
Assert.AreEqual(matchedClient.SceneManager.ClientSynchronizationMode, authority.SceneManager.ClientSynchronizationMode);
102-
break;
103-
}
97+
{
98+
var authority = GetAuthorityNetworkManager();
99+
var matchedClient = m_ClientNetworkManagers.FirstOrDefault(c => c.LocalClientId == sceneEvent.ClientId);
100+
Assert.That(matchedClient, Is.Not.Null, $"Found no client {nameof(NetworkManager)}s that had a {nameof(NetworkManager.LocalClientId)} of {sceneEvent.ClientId}");
101+
Assert.AreEqual(matchedClient.SceneManager.ClientSynchronizationMode, authority.SceneManager.ClientSynchronizationMode);
102+
break;
103+
}
104104
}
105105
}
106106

@@ -311,6 +311,7 @@ public IEnumerator SceneLoadingAndNotifications([Values] LoadSceneMode loadScene
311311
// Check error status for trying to load an invalid scene name
312312
LogAssert.Expect(LogType.Error, $"Scene '{k_InvalidSceneName}' couldn't be loaded because it has not been added to the build settings scenes in build list.");
313313
Assert.AreEqual(authority.SceneManager.LoadScene(k_InvalidSceneName, LoadSceneMode.Additive), SceneEventProgressStatus.InvalidSceneName);
314+
Assert.Fail("Test reruns!");
314315
}
315316

316317

0 commit comments

Comments
 (0)