/// <summary>
        /// Creates Module Attribute
        /// </summary>
        /// <param name="apiModule">ApiModule</param>
        /// <param name="name"> Name of the Module Attribute</param>
        /// <param name="valueRange">ValueRange of the Module Attribute</param>
        /// <param name="value">Default value of the Module Attribute</param>
        /// <param name="pathType">pathType of the Module Attribute</param>
        /// <param name="path">path of the Module Attribute</param>
        /// <param name="actionMode">Default ActionMode of the Module Attribute</param>
        /// <param name="dataType">Data Type of the Module Attribute</param>
        /// <returns>Module Attribute</returns>
        public static XModuleAttribute CreateModuleAttribute(this ApiModule apiModule,
                                                             string name,
                                                             string valueRange,
                                                             string value,
                                                             string pathType,
                                                             string path,
                                                             XTestStepActionMode actionMode =
                                                             XTestStepActionMode.Verify,
                                                             ModuleAttributeDataType dataType =
                                                             ModuleAttributeDataType.String)
        {
            XModuleAttribute xModuleAttribute =
                apiModule.CreateModuleAttribute();

            xModuleAttribute.Name         = name;
            xModuleAttribute.DefaultValue = value;
            if (!string.IsNullOrEmpty(valueRange))
            {
                xModuleAttribute.ValueRange = valueRange;
            }
            xModuleAttribute.EnsureUniqueName();
            xModuleAttribute.AddXParamToModuleAttribute("PathType", pathType, ParamTypeE.TechnicalID);
            xModuleAttribute.AddXParamToModuleAttribute("Path", path, ParamTypeE.TechnicalID);
            xModuleAttribute.AddXParamToModuleAttribute("ExplicitName", "True", ParamTypeE.Configuration);
            xModuleAttribute.DefaultActionMode = actionMode;
            xModuleAttribute.DefaultDataType   = dataType;
            return(xModuleAttribute);
        }
 /// <summary>
 /// Creates module attribute for Query params in Api module.
 /// </summary>
 /// <param name="apiModule">apiModule under which module attribute gets created.</param>
 /// <param name="wseTestStepValue">wsetesstep value to set in api module attribute</param>
 /// <returns></returns>
 protected override XModuleAttribute CreateModuleAttribute(ApiModule apiModule,
                                                           KeyValuePair <string, string> wseTestStepValue)
 {
     return(apiModule.CreateModuleAttribute(wseTestStepValue.Key,
                                            String.Empty,
                                            "UrlParam",
                                            $"{wseTestStepValue.Key};Query;0",
                                            XTestStepActionMode.Insert));
 }
Exemple #3
0
 CreateModuleAttribute(ApiModule apiModule, XTestStepValue wseTestStepValue)
 {
     return(apiModule.CreateModuleAttribute(
                "Endpoint",
                GetRefinedWseTestStepValue(wseTestStepValue.Value),
                GetRefinedWseTestStepValue(wseTestStepValue.Value),
                "Endpoint",
                "Endpoint",
                wseTestStepValue.ModuleAttribute.DefaultActionMode,
                wseTestStepValue.ModuleAttribute.DefaultDataType));
 }
Exemple #4
0
 /// <summary>
 /// Creates module attribute for response headers.
 /// </summary>
 /// <param name="apiModule">apiModule</param>
 /// <param name="wseTestStepValue">testStepValue of WSE</param>
 /// <returns>returns module attribute</returns>
 protected override XModuleAttribute CreateModuleAttribute(ApiModule apiModule,
                                                           KeyValuePair <string, string> wseTestStepValue)
 {
     return(apiModule.CreateModuleAttribute(
                wseTestStepValue.Key,
                wseTestStepValue.Value,
                wseTestStepValue.Value,
                "Header",
                wseTestStepValue.Key,
                XTestStepActionMode.Insert));
 }
 CreateModuleAttribute(ApiModule apiModule, XTestStepValue wseTestStepValue)
 {
     return(apiModule.CreateModuleAttribute(
                "StatusCode",
                HttpStatusCodeExtension.ValueRange(),
                wseTestStepValue.ModuleAttribute.DefaultValue,
                "StatusCode",
                "StatusCode",
                wseTestStepValue.ModuleAttribute.DefaultActionMode,
                wseTestStepValue.ModuleAttribute.DefaultDataType));
 }
 CreateModuleAttribute(ApiModule apiModule, XTestStepValue wseTestStepValue)
 {
     return(apiModule.CreateModuleAttribute(
                "Method",
                HttpMethodExtension.ValueRangeString(),
                wseTestStepValue
                .ModuleAttribute.DefaultValue,
                "Method",
                "Method",
                wseTestStepValue
                .ModuleAttribute
                .DefaultActionMode,
                wseTestStepValue
                .ModuleAttribute
                .DefaultDataType));
 }