示例#1
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);
        }