OpenTAP 9.25
API Reference
Public Member Functions | Static Public Member Functions | Properties | List of all members
OpenTap.MacroString Class Reference

a string that can be expanded with macros. More...

Public Member Functions

 MacroString (ITestStepParent context)
 Creates a new instance of MacroString with a context. More...
 
 MacroString ()
 Creates a new MacroString without a context. If a TestStep is used use that as context to get access to TestPlan related macros.
 
string Expand (TestPlanRun run=null, DateTime? date=null, string testPlanDir=null)
 Expands the text. Macros are harvested from the optional TestPlanRun or the test step. More...
 
string Expand (TestPlanRun run, DateTime? date, string testPlanDir, Dictionary< string, object > replacements)
 Expands the text. Macros are harvested from the optional TestPlanRun or the test step. More...
 
override string ToString ()
 Expands the text.
 

Static Public Member Functions

static implicit operator string (MacroString macroString)
 Implicit to string conversion that expands the text of the macroString. This makes it possible to seamlessly switch between string and MacroString in implementation.
 

Properties

ITestStepParent Context [getset]
 Optional context for macro strings that refers to a test step. This is used to find additional macro definitions such as TestPlanDir.
 
string Text [getset]
 The text that can be expanded.
 

Detailed Description

a string that can be expanded with macros.

Constructor & Destructor Documentation

◆ MacroString()

OpenTap.MacroString.MacroString ( ITestStepParent  context)
inline

Creates a new instance of MacroString with a context.

Parameters
context

Member Function Documentation

◆ Expand() [1/2]

string OpenTap.MacroString.Expand ( TestPlanRun  run,
DateTime?  date,
string  testPlanDir,
Dictionary< string, object >  replacements 
)
inline

Expands the text. Macros are harvested from the optional TestPlanRun or the test step.

Parameters
runA place to find additional metadata for macro expansion.
dateIf no date was found in the metadata, this date will be used. If date is not supplied, DateTime.Now will be used.
testPlanDirIf no TestPlanDir was found in the metata, this TestPlanDir will be used.
replacementsOverrides other macro parameters.
Returns
The expanded string.

◆ Expand() [2/2]

string OpenTap.MacroString.Expand ( TestPlanRun  run = null,
DateTime?  date = null,
string  testPlanDir = null 
)
inline

Expands the text. Macros are harvested from the optional TestPlanRun or the test step.

Parameters
runA place to find additional metadata for macro expansion.
dateIf no date was found in the metadata, this date will be used. If date is not supplied, DateTime.Now will be used.
testPlanDirIf no TestPlanDir was found in the metata, this TestPlanDir will be used.
Returns
The expanded string.

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