Esempio n. 1
0
        public void GivenItContainsDataMergeAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfDataMergeActivity activity = new DsfDataMergeActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable  = tableRow["Variable"];
                var type      = tableRow["Type"];
                var at        = tableRow["Using"];
                var padding   = tableRow["Padding"];
                var alignment = tableRow["Alignment"];

                activity.MergeCollection.Add(new DataMergeDTO(variable, type, at, 1, padding, alignment, true));
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 2
0
        public void GivenItContainsReplaceIntoAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfReplaceActivity activity = new DsfReplaceActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable     = tableRow["In Fields"];
                var find         = tableRow["Find"];
                var replaceValue = tableRow["Replace With"];

                activity.FieldsToSearch = variable;
                activity.Find           = find;
                activity.ReplaceWith    = replaceValue;
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 3
0
        public void GivenItContainFindUniqueAs(string parentName, string activityName, Table table)
        {
            DsfUniqueActivity activity = new DsfUniqueActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var inFields     = tableRow["In Fields"];
                var returnFields = tableRow["Return Fields"];
                var result       = tableRow["Result"];

                activity.InFields     = inFields;
                activity.ResultFields = returnFields;
                activity.Result       = result;

                CommonSteps.AddVariableToVariableList(result);
            }
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 4
0
        public void GivenItContainsFindRecordIndexSearchAndResultAs(string parentName, string activityName, string recsetToSearch, string resultVariable, Table table)
        {
            var result = resultVariable;
            var recset = recsetToSearch;

            CommonSteps.AddVariableToVariableList(result);
            DsfFindRecordsMultipleCriteriaActivity activity = new DsfFindRecordsMultipleCriteriaActivity {
                RequireAllFieldsToMatch = false, RequireAllTrue = false, Result = result, FieldsToSearch = recset, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var matchType  = tableRow["Match Type"];
                var matchValue = tableRow["Match"];

                activity.ResultsCollection.Add(new FindRecordsTO(matchValue, matchType, 1, true));
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 5
0
        public void GivenIHaveWorkflowWithPostgresDatabaseConnector(string workflowName, string activityName)
        {
            var environmentModel = _scenarioContext.Get <IServer>("server");

            environmentModel.Connect();
            CreateNewResourceModel(workflowName, environmentModel);
            CreateDBServiceModel(environmentModel);

            var dbServiceModel = _scenarioContext.Get <ManageDbServiceModel>("dbServiceModel");
            var posgreActivity = new DsfPostgreSqlActivity {
                DisplayName = activityName
            };
            var modelItem = ModelItemUtils.CreateModelItem(posgreActivity);
            var posgreDesignerViewModel = new PostgreSqlDatabaseDesignerViewModel(modelItem, dbServiceModel, new SynchronousAsyncWorker(), new ViewPropertyBuilder());
            var serviceInputViewModel   = new ManageDatabaseServiceInputViewModel(posgreDesignerViewModel, posgreDesignerViewModel.Model);

            _commonSteps.AddActivityToActivityList(workflowName, activityName, posgreActivity);
            DebugWriterSubscribe(environmentModel);
            _scenarioContext.Add("viewModel", posgreDesignerViewModel);
            _scenarioContext.Add("parentName", workflowName);
        }
Esempio n. 6
0
        public void GivenItContainsFindIndexIntoAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfIndexActivity activity = new DsfIndexActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable  = tableRow["In Fields"];
                var index     = tableRow["Index"];
                var character = tableRow["Character"];
                var direction = tableRow["Direction"];

                activity.InField    = variable;
                activity.Index      = index;
                activity.Characters = character;
                activity.Direction  = direction;
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 7
0
        public void GivenIHaveWorkflowWithMySqlDatabaseConnector(string workflowName, string activityName)
        {
            var environmentModel = _scenarioContext.Get <IServer>("server");

            environmentModel.Connect();
            _containerOps = TestLauncher.StartLocalMySQLContainer(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestResults"));
            CreateNewResourceModel(workflowName, environmentModel);
            CreateDBServiceModel(environmentModel);

            var dbServiceModel = _scenarioContext.Get <ManageDbServiceModel>("dbServiceModel");
            var mySqlActivity  = new DsfMySqlDatabaseActivity {
                DisplayName = activityName
            };
            var modelItem = ModelItemUtils.CreateModelItem(mySqlActivity);
            var mysqlDesignerViewModel = new MySqlDatabaseDesignerViewModel(modelItem, dbServiceModel, new SynchronousAsyncWorker(), new ViewPropertyBuilder());
            var serviceInputViewModel  = new ManageDatabaseServiceInputViewModel(mysqlDesignerViewModel, mysqlDesignerViewModel.Model);

            _commonSteps.AddActivityToActivityList(workflowName, activityName, mySqlActivity);
            DebugWriterSubscribe(environmentModel);
            _scenarioContext.Add("viewModel", mysqlDesignerViewModel);
            _scenarioContext.Add("parentName", workflowName);
        }
Esempio n. 8
0
        public void GivenContainsAnDeleteFolderAs(string parentName, string activityName, Table table)
        {
            DsfPathDelete activity = new DsfPathDelete {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable = tableRow["Recordset"];
                //var userName = tableRow["Username"];
                //var password = tableRow["Password"];
                var result = tableRow["Result"];

                activity.Result    = result;
                activity.InputPath = variable;
                //activity.Username = userName;
                //activity.Password = password;

                CommonSteps.AddVariableToVariableList(result);
            }
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 9
0
        public void GivenItContainsRandomAs(string parentName, string activityName, Table table)
        {
            var activity = new DsfRandomActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var type   = (enRandomType)Enum.Parse(typeof(enRandomType), tableRow["Type"]);
                var from   = tableRow["From"];
                var to     = tableRow["To"];
                var result = tableRow["Result"];

                CommonSteps.AddVariableToVariableList(result);

                activity.RandomType = type;
                activity.To         = to;
                activity.From       = from;
                activity.Result     = result;
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 10
0
        public void GivenContainsAnCreateAs(string parentName, string activityName, Table table)
        {
            DsfPathCreate activity = new DsfPathCreate {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable = tableRow["File or Folder"];
                var exist    = tableRow["If it exits"];
                var userName = tableRow["Username"];
                var password = tableRow["Password"];
                var result   = tableRow["Result"];

                activity.Result     = result;
                activity.Username   = userName;
                activity.Password   = password;
                activity.Overwrite  = exist == "True";
                activity.OutputPath = variable;

                CommonSteps.AddVariableToVariableList(result);
            }
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Esempio n. 11
0
        public void GivenIHaveASequence(string sequenceName)
        {
            var dsfSequence = new DsfSequenceActivity {
                DisplayName = sequenceName
            };

            scenarioContext.Add("activityList", new Dictionary <string, Activity>());
            scenarioContext.Add("activity", dsfSequence);
            _commonSteps.AddActivityToActivityList("", sequenceName, dsfSequence);
            Assert.AreEqual(enFindMissingType.Sequence, dsfSequence.GetFindMissingType());
        }