Copy Code
|
|
---|---|
Private Sub AddParamsAndSteps(ByRef myComponent) ' Add parameters and steps to a Component Dim compParamFactory As ComponentParamFactory Dim compParam1, compParam2, compParam3 As ComponentParam Dim compStepFactory As ComponentStepFactory Dim compStep1, compStep2 As ComponentStep Set compParamFactory = myComponent.ComponentParamFactory Set compStepFactory = myComponent.ComponentStepFactory Set compParam1 = compParamFactory.AddItem(Null) 'NOTICE, 1 is for true and 0 for false (The type is BOOL and not VARIANT_BOOL) compParam1.IsOut = 1 compParam1.name = "OutParam" compParam1.desc = "Description for output parameter" compParam1.ValueType = "String" compParam1.order = 1 compParam1.Post Set compParam2 = compParamFactory.AddItem(Null) compParam2.IsOut = 0 compParam2.name = "InParam" compParam2.desc = "Description for input parameter" compParam2.ValueType = "String" compParam2.order = 1 compParam2.Post Set compParam3 = compParamFactory.AddItem(Null) compParam3.IsOut = 0 compParam3.name = "InParam2" compParam3.desc = "Description for input parameter number two" compParam3.ValueType = "String" compParam3.order = 2 compParam3.Post Set compStep1 = compStepFactory.AddItem(Null) compStep1.StepName = "First Step" 'NOTICE that the badParamName parameter, that appears in the ExpectedResult, is not really a parameter name 'and therefore <<<badParamName>>> will be replaced with <badParamName> to mark that it was not recognized 'as a parameter. compStep1.StepDescription = "<html><body>Description can contain <<<InParam>>> that are verified by QC</body></html>" compStep1.StepExpectedResult = "<html><body>Can also contain <<<OutParam>>> and <<<badParamName>>></body></html>" compStep1.order = 1 compStep1.Validate 'will result in exception because of the badParamName. compStep1.Post myComponent.Post End Sub |