docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Namespace Unity.Netcode.TestHelpers.Runtime

    Classes

    ConditionalPredicateBase

    Derive from this class to create your own conditional handling for your NetcodeIntegrationTest integration tests when dealing with more complicated scenarios where initializing values, storing state to be used across several integration tests.

    IntegrationTestWithApproximation

    MessageHookEntry

    MessageHooksConditional

    MockTimeProvider

    NetcodeIntegrationTest

    The default Netcode for GameObjects integration test helper class

    NetcodeIntegrationTestHelpers

    Provides helpers for running multi instance tests.

    NetcodeIntegrationTestHelpers.ResultWrapper<T>

    Used to return a value of type T from a wait condition

    NetworkManagerHelper

    Helper class to instantiate a NetworkManager This also provides the ability to: --- instantiate GameObjects with NetworkObject components that returns a Guid for accessing it later. --- add NetworkBehaviour components to the instantiated GameObjects --- spawn a NetworkObject using its parent GameObject's Guid Call StartNetworkManager in the constructor of your runtime unit test class. Call ShutdownNetworkManager in the destructor of your runtime unit test class.

    Includes a useful "BuffersMatch" method that allows you to compare two buffers (returns true if they match false if not)

    NetworkVariableBaseHelper

    The BaseNetworkVariableHelper keeps track of: The number of instances and associates the instance with the NetworkVariable The number of times a specific NetworkVariable instance had its value changed (i.e. !Equal) Note: This could be expanded for future tests focuses around NetworkVariables

    NetworkVariableHelper<T>

    Will automatically register for the NetworkVariable OnValueChanged delegate handler. It then will expose that single delegate invocation to anything that registers for this NetworkVariableHelper's instance's OnValueChanged event. This allows us to register any NetworkVariable type as well as there are basically two "types of types":

    • IEquatable<T>
    • ValueType
    From both we can then at least determine if the value indeed changed

    ObjectNameIdentifier

    TimeoutFrameCountHelper

    This can be used in place of TimeoutHelper if you suspect a test is having issues on a system where the frame rate is running slow than expected and allowing a certain number of frame updates is required.

    TimeoutHelper

    Can be used independently or assigned to WaitForConditionOrTimeOut(Func<bool>, TimeoutHelper) in the event the default timeout period needs to be adjusted

    Interfaces

    IConditionalPredicate

    Enums

    NetcodeIntegrationTest.HostOrServer

    NetcodeIntegrationTest.NetworkManagerInstatiationMode

    NetcodeIntegrationTest.SceneManagementState

    NetworkManagerHelper.NetworkManagerOperatingMode

    This provides the ability to start NetworkManager in various modes

    ReceiptType

    Delegates

    NetcodeIntegrationTestHelpers.BeforeClientStartCallback

    NetcodeIntegrationTestHelpers.MessageHandleCheck

    NetworkVariableHelper<T>.OnMyValueChangedDelegateHandler

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)