Struct SimulationTestContext<TNodeData> | Data Flow Graph | 0.19.0-preview.7
docs.unity3d.com
    Show / Hide Table of Contents

    Struct SimulationTestContext<TNodeData>

    A unique node testing context provided to test functions (SimulationTestFunctionWithContext<TNodeData>) that are injected into simulation via SendTest<TNodeData>(NodeHandle, SimulationTestFunctionWithContext<TNodeData>). Allows recovery of the tested node's simulation data in order for the function to make assertions about its contents and throw exceptions (such as those from an ).

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.GetType()
    Object.ReferenceEquals(Object, Object)
    Namespace: Unity.DataFlowGraph
    Syntax
    public struct SimulationTestContext<TNodeData>
        where TNodeData : struct, INodeData
    Type Parameters
    Name Description
    TNodeData

    Properties

    NodeData

    The INodeData instance associated with the node currently being tested.

    Declaration
    public TNodeData NodeData { get; }
    Property Value
    Type Description
    TNodeData

    Methods

    Exists(NodeHandle)

    Tests whether the supplied node handle refers to a currently valid node instance.

    Declaration
    public bool Exists(NodeHandle handle)
    Parameters
    Type Name Description
    NodeHandle handle
    Returns
    Type Description
    Boolean

    SendTest<TSubNodeData>(NodeHandle, SimulationTestFunction<TSubNodeData>)

    Shorthand version of SendTest<TSubNodeData>(NodeHandle, SimulationTestFunctionWithContext<TSubNodeData>) omitting the SimulationTestContext<TNodeData> for simple test cases which do not require testing of child nodes.

    Declaration
    public void SendTest<TSubNodeData>(NodeHandle handle, SimulationTestFunction<TSubNodeData> code)
        where TSubNodeData : struct, INodeData
    Parameters
    Type Name Description
    NodeHandle handle
    SimulationTestFunction<TSubNodeData> code
    Type Parameters
    Name Description
    TSubNodeData
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the given TSubNodeData type does not correspond to that declared in the node's NodeDefinition

    SendTest<TSubNodeData>(NodeHandle, SimulationTestFunctionWithContext<TSubNodeData>)

    Allows testing child nodes of this node. Child nodes are exclusively direct descendants that were created by the node associated with this SimulationTestContext<TNodeData>. Specifying any other node handle is undefined behaviour. SendTest<TNodeData>(NodeHandle, SimulationTestFunctionWithContext<TNodeData>)

    Declaration
    public void SendTest<TSubNodeData>(NodeHandle handle, SimulationTestFunctionWithContext<TSubNodeData> code)
        where TSubNodeData : struct, INodeData
    Parameters
    Type Name Description
    NodeHandle handle
    SimulationTestFunctionWithContext<TSubNodeData> code
    Type Parameters
    Name Description
    TSubNodeData
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the given TSubNodeData type does not correspond to that declared in the node's NodeDefinition

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023