/// <summary>
        /// Builds the index of the parameter.
        /// </summary>
        /// <param name="fullMethodDescription">The full method description.</param>
        /// <param name="parameter">The parameter.</param>
        /// <param name="index">The index.</param>
        /// <param name="arrayFieldInfo">The array field information.</param>
        /// <returns>A string containing the parameter index.</returns>
        private string BuildParameterIndex(FullMethodDescription fullMethodDescription, MethodParameter parameter, int index, FieldInfo arrayFieldInfo)
        {
            // ";string,BDDComponentForTest.GivenMethod.stringParam.fullId,stringsArrayStorage.Array.data[0];"
            MethodsManagementUtilities methodsManagementUtilities = new MethodsManagementUtilities();

            return(parameter.ParameterInfoObject.ParameterType.FullName + "," + fullMethodDescription.GetFullName() + "." +
                   parameter.ParameterInfoObject.Name + "." + methodsManagementUtilities.GetMainFullId(fullMethodDescription.MainMethod) + fullMethodDescription.Id + "," + arrayFieldInfo.Name + ".Array.data[" + index + "]");
        }
Beispiel #2
0
        /// <summary>
        /// Gets the <see cref="FullMethodDescription"/> for the method declared by the <see cref="CallBefore"/> attribute.
        /// </summary>
        /// <param name="callBefore">The call before.</param>
        /// <param name="mainMethod">The main method.</param>
        /// <param name="parametersIndex">Index of the parameters.</param>
        /// <returns>The <see cref="FullMethodDescription"/> for the method declared by the <see cref="CallBefore"/> attribute.</returns>
        private FullMethodDescription GetCallBeforeFullMethodDescription(CallBefore callBefore, FullMethodDescription mainMethod, string parametersIndex)
        {
            MethodInfo                 methodInfo                 = mainMethod.ComponentObject.GetType().GetMethod(callBefore.Method);
            MethodParametersLoader     methodParametersLoader     = new MethodParametersLoader();
            MethodsManagementUtilities methodsManagementUtilities = new MethodsManagementUtilities();
            string           fullId           = methodsManagementUtilities.GetMainFullId(mainMethod) + callBefore.Id;
            MethodParameters methodParameters = methodParametersLoader.LoadMethodParameters(mainMethod.ComponentObject, methodInfo, fullId, parametersIndex);

            FullMethodDescription result = this.GetFullMethodDescription(mainMethod.ComponentObject, methodInfo, mainMethod.StepType, mainMethod.Text, methodParameters, string.Empty, 0, callBefore.Delay, callBefore.Timeout, callBefore.ExecutionOrder, callBefore.Id, mainMethod);

            return(result);
        }
        /// <summary>
        /// Gets the header text for the parameters area.
        /// </summary>
        /// <param name="fullMethodDescription">The full method description.</param>
        /// <returns>The header text for the parameters area.</returns>
        private string GetHeaderTextForFullMethodDescription(FullMethodDescription fullMethodDescription)
        {
            string result = "Method ";

            string methodName = fullMethodDescription.Method.Name;
            MethodsManagementUtilities methodsManagementUtilities = new MethodsManagementUtilities();
            string fullId = methodsManagementUtilities.GetMainFullId(fullMethodDescription.MainMethod) + fullMethodDescription.Id;

            result += methodName;
            if (!fullId.Equals(string.Empty))
            {
                result += " Id=" + fullId;
            }

            return(result);
        }