Class SelectTests
Inherited Members
Namespace: Unity.VisualScripting.Tests.Units.Control
Assembly: solution.dll
Syntax
public class SelectTests : BaseGraphExecutionTests
Methods
SimpleTest(bool)
A basic test of the Select unit.
Declaration
public void SimpleTest(bool cond)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | cond | The value to pass to the condition input |
TestAcceptsNullInputs(bool)
Tests that the input values can be null.
Declaration
public void TestAcceptsNullInputs(bool cond)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | cond | The value to pass to the condition input |
TestAcceptsObjectCondition(bool)
We can connect an input of type object to the condition input of the Select unit, and if the value is a bool, everything will work as expected.
Declaration
public void TestAcceptsObjectCondition(bool cond)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | cond |
TestPortAttributes()
Tests that the ports of the select node are of the expected types.
Declaration
public void TestPortAttributes()
TestPortsDisconnected(bool, bool, bool, bool)
Tests the behaviour when ports are not connected.
Declaration
public void TestPortsDisconnected(bool cond, bool conditionDisconnected, bool trueDisconnected, bool falseDisconnected)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | cond | The input for the condition node |
| bool | conditionDisconnected | Whether the condition node is disconnected |
| bool | trueDisconnected | Whether the true node is disconnected |
| bool | falseDisconnected | Whether the false node is disconnected |
TestWrongTypeConditionNode()
If we attempt to connect a condition of the wrong type, i.e. not bool, we get an InvalidConnectionException.
Declaration
public void TestWrongTypeConditionNode()
TestWrongTypeConditionValue()
We can connect an input of type object to the condition input of the Select unit, but if the object does not contain a value that can be converted to a bool, we'll get a InvalidConversionException.
Declaration
public void TestWrongTypeConditionValue()