Class SwitchOnStringTests
Inherited Members
Namespace: Unity.VisualScripting.Tests.Units.Control
Assembly: solution.dll
Syntax
public class SwitchOnStringTests : BaseGraphExecutionTests
Methods
CaseInsensitiveTest(string)
Tests that the input is compared without considering case when ignoreCase is set.
Declaration
public void CaseInsensitiveTest(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input |
CaseSensitiveTest(string)
Tests that the input is compared without considering case when ignoreCase is set.
Declaration
public void CaseSensitiveTest(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input |
NullInputTest()
If there is no null or empty branch, a null input will trigger the default case.
Declaration
public void NullInputTest()
SimpleTest(string)
A basic test of the SwitchOnString node.
Declaration
public void SimpleTest(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input |
TestNullEmptyMatches(string, string, bool)
Test combinations of empty strings and nulls, which should compare as if the same.
Declaration
public void TestNullEmptyMatches(string input, string branch, bool ignoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input | |
| string | branch | |
| bool | ignoreCase |
TestOutputPorts()
The SwitchOnString node has an output port for each option the user has added in the UI and also a "Default" one. The user ones are surrounded by quotes.
Declaration
public void TestOutputPorts()
TestTwoIdenticalStrings()
Test what happens if we add two options with identical strings.
Declaration
public void TestTwoIdenticalStrings()
TestTwoIdenticalStringsDifferingCase(string)
If we have two options with strings differing only in case, the first one will always be triggered for input of any case of this string.
Declaration
public void TestTwoIdenticalStringsDifferingCase(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input |