Exemple #1
0
        /// <summary>
        /// Identify location of existing WSE Specialized Modules and create generic folder for storing API modules
        /// </summary>
        /// <param name="rootComponentFolder"> Component Folder at which migration is executing </param>
        /// <param name="xTestStep">TestStep for WseArtifacts</param>
        /// <param name="parserResult">Transport information used to fill in Request and Response Module</param>
        /// <returns></returns>
        public (TCFolder, string) CreateFolderForApiModules(TCObject rootComponentFolder,
                                                            XTestStep xTestStep,
                                                            IWseArtifactsParser parserResult)
        {
            if (SpecializationHelper.IsRequestIsUsingEmbeddedModule(xTestStep, out XModule requestSpecializationModule)
                )
            {
                return(CreateFolderForApiModules(requestSpecializationModule), requestSpecializationModule.Name);
            }

            if (SpecializationHelper.IsResponseIsUsingEmbeddedModule(xTestStep,
                                                                     out XModule responseSpecializationModule))
            {
                return(CreateFolderForApiModules(responseSpecializationModule), responseSpecializationModule.Name);
            }

            var apiModulesFolder = GetOrCreateApiModulesFolder(rootComponentFolder);
            var moduleName       = CommonUtilities.CreateModuleFolderName(xTestStep, parserResult);
            var folder           = apiModulesFolder.CreateFolder();

            folder.Name = $"API_{moduleName}";
            folder.EnsureUniqueName();
            return(folder, moduleName);
        }