Class NetcodeIntegrationTestHelpers
Provides helpers for running multi instance tests.
Inherited Members
Namespace: Unity.Netcode.TestHelpers .Runtime
Assembly: solution.dll
Syntax
public static class NetcodeIntegrationTestHelpers
Fields
Name | Description |
---|---|
Default |
|
Default |
Properties
Name | Description |
---|---|
Is |
|
Network |
Methods
Name | Description |
---|---|
Clean |
Call this to clean up the IntegrationTestSceneHandler and destroy the s_CoroutineRunner.
Note:
If deriving from Netcode |
Create(int, out Network |
Creates NetworkingManagers and configures them for use in a multi instance setting. |
Create |
|
Create |
Used to add a client to the already existing list of clients |
Create |
|
Destroy() | Should always be invoked when finished with a single unit test (i.e. during TearDown) |
Get |
|
Get |
Gets a NetworkObject instance as it's represented by a certain peer. |
Get |
Gets a NetworkObject instance as it's represented by a certain peer. |
Get |
Gets a NetworkObject instance as it's represented by a certain peer. |
Get |
|
Make |
Normally we would only allow player prefabs to be set to a prefab. Not runtime created objects. In order to prevent having a Resource folder full of a TON of prefabs that we have to maintain, MultiInstanceHelper has a helper function that lets you mark a runtime created object to be treated as a prefab by the Netcode. That's how we can get away with creating the player prefab at runtime without it being treated as a SceneObject or causing other conflicts with the Netcode. |
Mark |
|
Register |
Call this to register scene validation and the IntegrationTestSceneHandler
Note:
If deriving from Netcode |
Register |
|
Start(bool, Network |
Starts NetworkManager instances created by the Create method. |
Start |
Starts one single client and makes sure to register the required hooks and handlers |
Stop |
Stops one single client and makes sure to cleanup any static variables in this helper |
Wait |
Waits on the client side to be connected. |
Wait |
Waits on the server side for 1 client to be connected |
Wait |
|
Wait |
Waits on the server side for 1 client to be connected |
Wait |
Waits for a predicate condition to be met |