OpenTAP 9.25
API Reference
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | List of all members
OpenTap.TestStepList Class Reference

This class holds a list of TestSteps and is used for the Children property of TestStepBase. It is responsible for making sure that all TestSteps added to the list are supported/allowed as children of the TestStep in the TestStepList.Parent field. More...

Inherits ObservableCollection< ITestStep >.

Public Types

enum  ChildStepsChangedAction { AddedStep , RemovedStep , ListReplaced }
 Specifies what has changed. More...
 

Public Member Functions

 TestStepList ()
 Constructor for the TestStepList.
 
bool CanInsertType (Type stepType)
 Returns true if a TestStep of type stepType can be inserted as a child step. More...
 
delegate void ChildStepsChangedDelegate (TestStepList senderList, ChildStepsChangedAction Action, ITestStep Object, int Index)
 Defines the callback interface that can get invoked when a child step lists changes. More...
 
void RemoveItems (IEnumerable< ITestStep > steps)
 Removed a number of steps from the test plan. Also includes child steps of selected steps. More...
 
IEnumerable< ITestStepRecursivelyGetAllTestSteps (TestStepSearch stepSearch)
 Recursively iterates steps and child steps to collect all steps in the list. More...
 
IEnumerable< ITestStepGetSteps (TestStepSearch stepSearch)
 Gets steps based on the search pattern. Ignores child steps. Returns null if not found.
More...
 
ITestStep GetStep (Guid id)
 Returns the test step that matches the TestStep.Id. Returns null if not found. More...
 

Static Public Member Functions

static bool AllowChild (Type parentType, Type childType)
 Determines whether a TestStep of a specified type is allowed as child step to a parent of a specified type.
 
static bool AllowChild (ITypeData parentType, ITypeData childType)
 Determines whether a TestStep of a specified type is allowed as child step to a parent of a specified type.
 

Public Attributes

bool EnforceNestingRulesOnInsert = true
 When true, the nesting rules defined by AllowAsChildInAttribute and AllowAnyChildAttribute are checked when trying to insert a step into this list. If the rules are not fulfilled the TestStep is not inserted and a warning is written to the log.
 

Protected Member Functions

override void ClearItems ()
 Removes all the items in the list.
 
override void InsertItem (int index, ITestStep item)
 Inserts an item into the collection at a specified index. More...
 
override void RemoveItem (int index)
 Removes the item at the specified index of the collection.
 

Properties

bool IsReadOnly [getset]
 Determines if the TestStepList is read only.
 
ITestStepParent Parent [getset]
 Parent item of type ITestStepParent to which this list belongs. TestSteps in this list (including TestSteps that are added later) will have this item set as their P:OpenTap.ITestStep.Parent.
 

Events

ChildStepsChangedDelegate ChildStepsChanged
 Invoked when TestStep.ChildTestSteps changes for this TestStepList and child TestStepLists.
 

Detailed Description

This class holds a list of TestSteps and is used for the Children property of TestStepBase. It is responsible for making sure that all TestSteps added to the list are supported/allowed as children of the TestStep in the TestStepList.Parent field.

Member Enumeration Documentation

◆ ChildStepsChangedAction

Specifies what has changed.

Enumerator
AddedStep 

Specifies that a step has been added to a list.

RemovedStep 

Specifies that a step has been removed from the list.

ListReplaced 

Specifies that the TestStepList has been replaced. The sender is in this case the new object. Object and Index will be null.

Member Function Documentation

◆ CanInsertType()

bool OpenTap.TestStepList.CanInsertType ( Type  stepType)
inline

Returns true if a TestStep of type stepType can be inserted as a child step.

Parameters
stepType
Returns

◆ ChildStepsChangedDelegate()

delegate void OpenTap.TestStepList.ChildStepsChangedDelegate ( TestStepList  senderList,
ChildStepsChangedAction  Action,
ITestStep  Object,
int  Index 
)

Defines the callback interface that can get invoked when a child step lists changes.

Parameters
senderListThe list that changed
ActionHow the list changed
ObjectWhich object changed in the list (might be null if Reset)
IndexThe index of the item changed.

◆ GetStep()

ITestStep OpenTap.TestStepList.GetStep ( Guid  id)
inline

Returns the test step that matches the TestStep.Id. Returns null if not found.

Parameters
id
Returns

◆ GetSteps()

IEnumerable< ITestStep > OpenTap.TestStepList.GetSteps ( TestStepSearch  stepSearch)
inline

Gets steps based on the search pattern. Ignores child steps. Returns null if not found.

Parameters
stepSearchSearch pattern.
Returns

◆ InsertItem()

override void OpenTap.TestStepList.InsertItem ( int  index,
ITestStep  item 
)
inlineprotected

Inserts an item into the collection at a specified index.

Parameters
indexLocation in list.
itemTo be inserted.

◆ RecursivelyGetAllTestSteps()

IEnumerable< ITestStep > OpenTap.TestStepList.RecursivelyGetAllTestSteps ( TestStepSearch  stepSearch)
inline

Recursively iterates steps and child steps to collect all steps in the list.

Parameters
stepSearchSearch pattern.
Returns

◆ RemoveItems()

void OpenTap.TestStepList.RemoveItems ( IEnumerable< ITestStep steps)
inline

Removed a number of steps from the test plan. Also includes child steps of selected steps.

Parameters
stepsThe steps to remove.

OpenTAP 9.25 API built Tue Aug 6 2024 07:49:24