public void DsfCalculateActivity_OnExecute_GetCurrentDateTime_ResultContainsMilliseconds() { TestStartNode = new FlowStep { Action = new DsfCalculateActivity { Expression = @"now()", Result = "[[result]]" } }; CurrentDl = "<ADL><result></result></ADL>"; TestData = "<root><ADL><result></result></ADL></root>"; IDSFDataObject result = ExecuteProcess(); string error; string entry; GetScalarValueFromEnvironment(result.Environment, "result", out entry, out error); // remove test datalist ;) DateTime res = DateTime.Parse(entry); if(res.Millisecond == 0) { Thread.Sleep(10); result = ExecuteProcess(); GetScalarValueFromEnvironment(result.Environment, "result", out entry, out error); res = DateTime.Parse(entry); Assert.IsTrue(res.Millisecond != 0); } Assert.IsTrue(res.Millisecond != 0); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); var recordset = ScenarioContext.Current.Get<string>("recordset"); var delete = new DsfDeleteRecordActivity { RecordsetName = recordset, Result = ResultVariable }; TestStartNode = new FlowStep { Action = delete }; ScenarioContext.Current.Add("activity", delete); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); var recordsetName = ScenarioContext.Current.Get<string>("recordset"); var sortOrder = ScenarioContext.Current.Get<string>("sortOrder"); var sortRecords = new DsfSortRecordsActivity { SortField = recordsetName, SelectedSort = sortOrder }; TestStartNode = new FlowStep { Action = sortRecords }; ScenarioContext.Current.Add("activity", sortRecords); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if (variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string header; ScenarioContext.Current.TryGetValue("header", out header); string url; ScenarioContext.Current.TryGetValue("url", out url); string timeout; ScenarioContext.Current.TryGetValue("timeoutSeconds", out timeout); var webGet = new DsfWebGetRequestWithTimeoutActivity { Result = ResultVariable, Url = url ?? "", Headers = header ?? "", TimeoutSeconds = String.IsNullOrEmpty(timeout) ? 100 : int.Parse(timeout), TimeOutText = String.IsNullOrEmpty(timeout) ? "" : timeout }; TestStartNode = new FlowStep { Action = webGet }; ScenarioContext.Current.Add("activity", webGet); }
protected override void BuildDataList() { BuildShapeAndTestData(); var copy = new DsfPathCopy { InputPath = ScenarioContext.Current.Get<string>(CommonSteps.SourceHolder), Username = ScenarioContext.Current.Get<string>(CommonSteps.SourceUsernameHolder), Password = ScenarioContext.Current.Get<string>(CommonSteps.SourcePasswordHolder), OutputPath = ScenarioContext.Current.Get<string>(CommonSteps.DestinationHolder), DestinationUsername = ScenarioContext.Current.Get<string>(CommonSteps.DestinationUsernameHolder), DestinationPassword = ScenarioContext.Current.Get<string>(CommonSteps.DestinationPasswordHolder), Overwrite = ScenarioContext.Current.Get<bool>(CommonSteps.OverwriteHolder), Result = ScenarioContext.Current.Get<string>(CommonSteps.ResultVariableHolder), PrivateKeyFile = ScenarioContext.Current.Get<string>(CommonSteps.SourcePrivatePublicKeyFile), DestinationPrivateKeyFile = ScenarioContext.Current.Get<string>(CommonSteps.DestinationPrivateKeyFile) }; TestStartNode = new FlowStep { Action = copy }; ScenarioContext.Current.Add("activity", copy); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string formula; ScenarioContext.Current.TryGetValue("formula", out formula); var calculate = new DsfCalculateActivity { Result = ResultVariable, Expression = formula }; TestStartNode = new FlowStep { Action = calculate }; ScenarioContext.Current.Add("activity", calculate); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string inField; ScenarioContext.Current.TryGetValue("inField", out inField); string returnField; ScenarioContext.Current.TryGetValue("returnField", out returnField); string resultVariable; ScenarioContext.Current.TryGetValue("resultVariable", out resultVariable); var unique = new DsfUniqueActivity { InFields = inField, ResultFields = returnField, Result = resultVariable }; TestStartNode = new FlowStep { Action = unique }; ScenarioContext.Current.Add("activity", unique); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string scriptToExecute; ScenarioContext.Current.TryGetValue("scriptToExecute", out scriptToExecute); enScriptType language; ScenarioContext.Current.TryGetValue("language", out language); var dsfScripting = new DsfScriptingActivity { Script = scriptToExecute, ScriptType = language, Result = ResultVariable }; TestStartNode = new FlowStep { Action = dsfScripting }; ScenarioContext.Current.Add("activity", dsfScripting); }
protected override void BuildDataList() { BuildShapeAndTestData(); string xmlData; ScenarioContext.Current.TryGetValue("xmlData", out xmlData); var xPath = new DsfXPathActivity { SourceString = xmlData }; TestStartNode = new FlowStep { Action = xPath }; List<Tuple<string, string>> xpathDtos; ScenarioContext.Current.TryGetValue("xpathDtos", out xpathDtos); int row = 1; foreach(var variable in xpathDtos) { xPath.ResultsCollection.Add(new XPathDTO(variable.Item1, variable.Item2, row, true)); row++; } ScenarioContext.Current.Add("activity", xPath); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string commandToExecute; ScenarioContext.Current.TryGetValue("commandToExecute", out commandToExecute); var commandLine = new DsfExecuteCommandLineActivity { CommandFileName = commandToExecute, CommandResult = ResultVariable, }; TestStartNode = new FlowStep { Action = commandLine }; ScenarioContext.Current.Add("activity", commandLine); }
public void FieldSpecifiedSortForwards_Numeric_Expected_Recordset_Sorted_Top_To_Bottom() { TestStartNode = new FlowStep { Action = new DsfSortRecordsActivity { SortField = "[[recset().Id]]", SelectedSort = "Forward" } }; SetupArguments( ActivityStrings.SortDataList_Shape , ActivityStrings.SortDataList , "[[recset().Id]]" , "Forward" ); IDSFDataObject result = ExecuteProcess(); List<string> expected = new List<string> { "1" , "1" , "2" , "3" , "4" , "6" , "7" , "8" , "9" , "10" }; string error; List<string> actual = RetrieveAllRecordSetFieldValues(result.Environment, "recset", "Id", out error); // remove test datalist ;) CollectionAssert.AreEqual(expected, actual, new ActivityUnitTests.Utils.StringComparer()); }
public void String_ForwardSort_String_Expected_RecordSetSortedAscending() { TestStartNode = new FlowStep { Action = new DsfSortRecordsActivity { SortField = "[[recset().Name]]", SelectedSort = "Forward" } }; SetupArguments( ActivityStrings.SortDataList_Shape , ActivityStrings.SortDataList , "[[recset().Name]]" , "Forward" ); IDSFDataObject result = ExecuteProcess(); List<string> expected = new List<string> { "A" , "A" , "A" , "B" , "C" , "F" , "F" , "L" , "Y" , "Z" }; string error; List<string> actual = RetrieveAllRecordSetFieldValues(result.Environment, "recset", "Name", out error); // remove test datalist ;) CollectionAssert.AreEqual(expected, actual, new ActivityUnitTests.Utils.StringComparer()); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); var dataMerge = new DsfDataMergeActivity { Result = ResultVariable }; List<Tuple<string, string, string, string, string>> mergeCollection; ScenarioContext.Current.TryGetValue("mergeCollection", out mergeCollection); int row = 1; foreach(var variable in mergeCollection) { dataMerge.MergeCollection.Add(new DataMergeDTO(variable.Item1, variable.Item2, variable.Item3, row, variable.Item4, variable.Item5)); row++; } TestStartNode = new FlowStep { Action = dataMerge }; ScenarioContext.Current.Add("activity", dataMerge); }
protected override void BuildDataList() { var variableList = ScenarioContext.Current.Get<List<Tuple<string, string>>>("variableList"); variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); var flowSwitch = new DsfFlowSwitchActivity { ExpressionText = string.Format( "Dev2.Data.Decision.Dev2DataListDecisionHandler.Instance.FetchSwitchData(\"{0}\",AmbientDataList)", variableList.First().Item1), }; var sw = new FlowSwitch<string>(); sw.Expression = flowSwitch; var multiAssign = new DsfMultiAssignActivity(); int row = 1; foreach(var variable in variableList) { multiAssign.FieldsCollection.Add(new ActivityDTO(variable.Item1, variable.Item2, row, true)); row++; } TestStartNode = new FlowStep { Action = multiAssign, Next = sw }; ScenarioContext.Current.Add("activity", flowSwitch); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); string resultVariable; ScenarioContext.Current.TryGetValue("resultVariable", out resultVariable); BuildShapeAndTestData(); string recordSetName; ScenarioContext.Current.TryGetValue("recordset", out recordSetName); var recordset = ScenarioContext.Current.Get<string>("recordset"); var count = new DsfCountRecordsetActivity { RecordsetName = recordset, CountNumber = string.IsNullOrEmpty(resultVariable) ? ResultVariable : resultVariable }; TestStartNode = new FlowStep { Action = count }; ScenarioContext.Current.Add("activity", count); }
protected override void BuildDataList() { try { BuildShapeAndTestData(); var zip = new DsfZip { InputPath = ScenarioContext.Current.Get<string>(CommonSteps.SourceHolder), Username = ScenarioContext.Current.Get<string>(CommonSteps.SourceUsernameHolder), Password = ScenarioContext.Current.Get<string>(CommonSteps.SourcePasswordHolder), OutputPath = ScenarioContext.Current.Get<string>(CommonSteps.DestinationHolder), DestinationUsername = ScenarioContext.Current.Get<string>(CommonSteps.DestinationUsernameHolder), DestinationPassword = ScenarioContext.Current.Get<string>(CommonSteps.DestinationPasswordHolder), Overwrite = ScenarioContext.Current.Get<bool>(CommonSteps.OverwriteHolder), Result = ScenarioContext.Current.Get<string>(CommonSteps.ResultVariableHolder), ArchivePassword = ScenarioContext.Current.Get<string>("archivePassword"), CompressionRatio = ScenarioContext.Current.Get<string>("compressio"), PrivateKeyFile = ScenarioContext.Current.Get<string>(CommonSteps.SourcePrivatePublicKeyFile), DestinationPrivateKeyFile = ScenarioContext.Current.Get<string>(CommonSteps.DestinationPrivateKeyFile) }; TestStartNode = new FlowStep { Action = zip }; // CI ScenarioContext.Current.Add("activity", zip); } catch(Exception e) { Dev2Logger.Log.Debug("Error Setting Up Zip",e); } }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string body; ScenarioContext.Current.TryGetValue("body", out body); string subject; ScenarioContext.Current.TryGetValue("subject", out subject); string fromAccount; ScenarioContext.Current.TryGetValue("fromAccount", out fromAccount); string password; ScenarioContext.Current.TryGetValue("password", out password); string simulationOutput; ScenarioContext.Current.TryGetValue("simulationOutput", out simulationOutput); string to; ScenarioContext.Current.TryGetValue("to", out to); bool isHtml; ScenarioContext.Current.TryGetValue("isHtml", out isHtml); var server = SimpleSmtpServer.Start(25); ScenarioContext.Current.Add("server", server); var selectedEmailSource = new EmailSource { Host = "localhost", Port = 25, UserName = "", Password = "", ResourceName = Guid.NewGuid().ToString(), ResourceID = Guid.NewGuid() }; ResourceCatalog.Instance.SaveResource(Guid.Empty, selectedEmailSource); var sendEmail = new DsfSendEmailActivity { Result = ResultVariable, Body = string.IsNullOrEmpty(body) ? "" : body, Subject = string.IsNullOrEmpty(subject) ? "" : subject, FromAccount = string.IsNullOrEmpty(fromAccount) ? "" : fromAccount, To = string.IsNullOrEmpty(to) ? "" : to, SelectedEmailSource = selectedEmailSource, IsHtml = isHtml }; TestStartNode = new FlowStep { Action = sendEmail }; ScenarioContext.Current.Add("activity", sendEmail); }
protected override void BuildDataList() { BuildShapeAndTestData(); var decisionActivity = new DsfFlowDecisionActivity(); Dev2DecisionMode mode; ScenarioContext.Current.TryGetValue("mode", out mode); var decisionModels = ScenarioContext.Current.Get<List<Tuple<string, enDecisionType, string, string>>>("decisionModels"); var dds = new Dev2DecisionStack { TheStack = new List<Dev2Decision>(), Mode = mode, TrueArmText = "YES", FalseArmText = "NO" }; foreach(var dm in decisionModels) { var dev2Decision = new Dev2Decision { Col1 = dm.Item1 ?? string.Empty, EvaluationFn = dm.Item2, Col2 = dm.Item3 ?? string.Empty, Col3 = dm.Item4 ?? string.Empty }; dds.AddModelItem(dev2Decision); } string modelData = dds.ToVBPersistableModel(); ScenarioContext.Current.Add("modelData", modelData); decisionActivity.ExpressionText = string.Join("", GlobalConstants.InjectedDecisionHandler, "(\"", modelData, "\",", GlobalConstants.InjectedDecisionDataListVariable, ")"); List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } var multiAssign = new DsfMultiAssignActivity(); int row = 1; foreach(var variable in variableList) { multiAssign.FieldsCollection.Add(new ActivityDTO(variable.Item1, variable.Item2, row, true)); row++; } FlowDecision x = new FlowDecision(); x.Condition=decisionActivity; TestStartNode = new FlowStep { Action = multiAssign, Next = x }; ScenarioContext.Current.Add("activity", decisionActivity); }
private static void CreateFlowchartUpdateMap() { ActivityBuilder wf = StartUpdate("FlowchartNumberGuessWorkflow.xaml"); // Get a reference to the root Flowchart activity. Flowchart fc = wf.Implementation as Flowchart; // Update the Text of the two WriteLine activities that write the // results of the user's guess. They are contained in the workflow as the // True and False action of the "Guess < Target" FlowDecision, which is // Nodes[4]. FlowDecision guessLow = fc.Nodes[4] as FlowDecision; // Update the "too low" message. FlowStep trueStep = guessLow.True as FlowStep; WriteLine tooLow = trueStep.Action as WriteLine; tooLow.Text = new CSharpValue<string>("Guess.ToString() + \" is too low.\""); // Update the "too high" message. FlowStep falseStep = guessLow.False as FlowStep; WriteLine tooHigh = falseStep.Action as WriteLine; tooHigh.Text = new CSharpValue<string>("Guess.ToString() + \" is too high.\""); // Add the new WriteLine that displays the closing message. WriteLine wl = new WriteLine { Text = new CSharpValue<string>("Guess.ToString() + \" is correct. You guessed it in \" + Turns.ToString() + \" turns.\"") }; // Create a FlowStep to hold the WriteLine. FlowStep closingStep = new FlowStep { Action = wl }; // Add this new FlowStep to the True action of the // "Guess == Guess" FlowDecision FlowDecision guessCorrect = fc.Nodes[3] as FlowDecision; guessCorrect.True = closingStep; // Add the new FlowStep to the Nodes collection. // If closingStep was replacing an existing node then // we would need to remove that Step from the collection. // In this example there was no existing True step to remove. fc.Nodes.Add(closingStep); // Create the update map. CreateUpdateMaps(wf, "FlowchartNumberGuessWorkflow.map"); // Save the updated workflow definition. SaveUpdatedDefinition(wf, "FlowchartNumberGuessWorkflow_du.xaml"); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if (variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); enRandomType randomType; ScenarioContext.Current.TryGetValue("randomType", out randomType); string length; ScenarioContext.Current.TryGetValue("length", out length); string rangeFrom; ScenarioContext.Current.TryGetValue("rangeFrom", out rangeFrom); string rangeTo; ScenarioContext.Current.TryGetValue("rangeTo", out rangeTo); var dsfRandom = new DsfRandomActivity { RandomType = randomType, Result = ResultVariable }; if (!string.IsNullOrEmpty(length)) { dsfRandom.Length = length; } if (!string.IsNullOrEmpty(rangeFrom)) { dsfRandom.From = rangeFrom; } if (!string.IsNullOrEmpty(rangeTo)) { dsfRandom.To = rangeTo; } TestStartNode = new FlowStep { Action = dsfRandom }; ScenarioContext.Current.Add("activity", dsfRandom); }
public void SetupScenerio() { var sqlBulkInsert = new DsfSqlBulkInsertActivity(); var dbSource = SqlServerTestUtils.CreateDev2TestingDbSource(); ResourceCatalog.Instance.SaveResource(Guid.Empty, dbSource); ScenarioContext.Current.Add("dbSource", dbSource); sqlBulkInsert.Database = dbSource; sqlBulkInsert.TableName = "SqlBulkInsertSpecFlowTestTable_for_" + ScenarioContext.Current.ScenarioInfo.Title.Replace(' ', '_'); var dataColumnMappings = new List<DataColumnMapping> { new DataColumnMapping { InputColumn = "[[rs(*).Col1]]", OutputColumn = new DbColumn { ColumnName = "Col1", DataType = typeof (Int32), MaxLength = 100 }, }, new DataColumnMapping { InputColumn = "[[rs(*).Col2]]", OutputColumn = new DbColumn { ColumnName = "Col2", DataType = typeof (String), MaxLength = 100 } }, new DataColumnMapping { InputColumn = "[[rs(*).Col3]]", OutputColumn = new DbColumn { ColumnName = "Col3", DataType = typeof (Guid), MaxLength = 100 } } }; sqlBulkInsert.InputMappings = dataColumnMappings; TestStartNode = new FlowStep { Action = sqlBulkInsert }; ScenarioContext.Current.Add("activity", sqlBulkInsert); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if(variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); BuildShapeAndTestData(); string inputDate; ScenarioContext.Current.TryGetValue("inputDate", out inputDate); string inputFormat; ScenarioContext.Current.TryGetValue("inputFormat", out inputFormat); string outputFormat; ScenarioContext.Current.TryGetValue("outputFormat", out outputFormat); string timeModifierType; ScenarioContext.Current.TryGetValue("timeModifierType", out timeModifierType); string timeModifierAmount; ScenarioContext.Current.TryGetValue("timeModifierAmount", out timeModifierAmount); //Ashley: Windows Server 2008 is too outdated to know GMT was renamed to UTC. if(Environment.OSVersion.ToString() == "Microsoft Windows NT 6.0.6002 Service Pack 2") { inputDate = inputDate.Replace("(UTC+", "(GMT+").Replace("(UTC-", "(GMT-"); } var dateTime = new DsfDateTimeActivity { Result = ResultVariable, DateTime = inputDate, InputFormat = inputFormat, OutputFormat = outputFormat, TimeModifierType = timeModifierType, TimeModifierAmountDisplay = timeModifierAmount }; TestStartNode = new FlowStep { Action = dateTime }; ScenarioContext.Current.Add("activity", dateTime); }
protected override void BuildDataList() { List<Tuple<string, string>> variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if (variableList == null) { variableList = new List<Tuple<string, string>>(); ScenarioContext.Current.Add("variableList", variableList); } variableList.Add(new Tuple<string, string>(ResultVariable, "")); var resultVariable = ResultVariable; string resultVar; if (ScenarioContext.Current.TryGetValue("resultVariable", out resultVar)) { resultVariable = resultVar; var resultVars = resultVariable.Split(','); variableList.AddRange(resultVars.Select(resVar => new Tuple<string, string>(resVar, ""))); } BuildShapeAndTestData(); string inField; ScenarioContext.Current.TryGetValue("inField", out inField); string index; ScenarioContext.Current.TryGetValue("index", out index); string characters; ScenarioContext.Current.TryGetValue("characters", out characters); string direction; ScenarioContext.Current.TryGetValue("direction", out direction); var findIndex = new DsfIndexActivity { Result = resultVariable, InField = inField, Index = index, Characters = characters, Direction = direction }; TestStartNode = new FlowStep { Action = findIndex }; ScenarioContext.Current.Add("activity", findIndex); }
protected override void BuildDataList() { BuildShapeAndTestData(); var systemInformationCollection = ScenarioContext.Current.Get<List<GatherSystemInformationTO>>("systemInformationCollection"); var dsfGatherSystemInformationActivity = new DsfGatherSystemInformationActivity { SystemInformationCollection = systemInformationCollection }; TestStartNode = new FlowStep { Action = dsfGatherSystemInformationActivity }; ScenarioContext.Current.Add("activity", dsfGatherSystemInformationActivity); }
private void SetupArguments(string currentDl, string testData, string result, string expression, enRoundingType roundingType, string roundingDecimalPlaces, string decimalPlacesToShow) { TestStartNode = new FlowStep { Action = new DsfNumberFormatActivity { Expression = expression, Result = result, RoundingType = Dev2EnumConverter.ConvertEnumValueToString(roundingType), RoundingDecimalPlaces = roundingDecimalPlaces, DecimalPlacesToShow = decimalPlacesToShow, } }; CurrentDl = testData; TestData = currentDl; }
protected override void BuildDataList() { BuildShapeAndTestData(); string stringToSplit; ScenarioContext.Current.TryGetValue("stringToSplit", out stringToSplit); List<DataSplitDTO> splitCollection; ScenarioContext.Current.TryGetValue("splitCollection", out splitCollection); var dataSplit = new DsfDataSplitActivity { SourceString = stringToSplit }; int row = 1; foreach(var dto in splitCollection) { dto.IndexNumber = row; dataSplit.ResultsCollection.Add(dto); row++; } bool reverseOrder; bool skipBlankRows; ScenarioContext.Current.TryGetValue("ReverseOrder", out reverseOrder); ScenarioContext.Current.TryGetValue("SkipBlankRows", out skipBlankRows); dataSplit.ReverseOrder = reverseOrder; dataSplit.SkipBlankRows = skipBlankRows; TestStartNode = new FlowStep { Action = dataSplit }; string errorVariable; ScenarioContext.Current.TryGetValue("errorVariable", out errorVariable); string webserviceToCall; ScenarioContext.Current.TryGetValue("webserviceToCall", out webserviceToCall); dataSplit.OnErrorVariable = errorVariable; dataSplit.OnErrorWorkflow = webserviceToCall; ScenarioContext.Current.Add("activity", dataSplit); }
protected override void BuildDataList() { BuildShapeAndTestData(); var delete = new DsfPathDelete { InputPath = ScenarioContext.Current.Get<string>(CommonSteps.SourceHolder), Username = ScenarioContext.Current.Get<string>(CommonSteps.SourceUsernameHolder).ResolveDomain(), Password = ScenarioContext.Current.Get<string>(CommonSteps.SourcePasswordHolder), Result = ScenarioContext.Current.Get<string>(CommonSteps.ResultVariableHolder) }; TestStartNode = new FlowStep { Action = delete }; ScenarioContext.Current.Add("activity", delete); }
//protected override void BuildDataList() //{ // List<Tuple<string, string>> variableList; // ScenarioContext.Current.TryGetValue("variableList", out variableList); // if(variableList == null) // { // variableList = new List<Tuple<string, string>>(); // ScenarioContext.Current.Add("variableList", variableList); // } // variableList.Add(new Tuple<string, string>(ResultVariable, "")); // BuildShapeAndTestData(); //} protected override void BuildDataList() { var shape = new XElement("root"); var data = new XElement("root"); // ReSharper disable NotAccessedVariable int row = 0; dynamic variableList; ScenarioContext.Current.TryGetValue("variableList", out variableList); if (variableList != null) { foreach (dynamic variable in variableList) { if (!string.IsNullOrEmpty(variable.Item1) && !string.IsNullOrEmpty(variable.Item2)) { DataObject.Environment.AssignWithFrame(new AssignValue(DataListUtil.AddBracketsToValueIfNotExist(variable.Item1), variable.Item2)); } row++; } DataObject.Environment.CommitAssign(); } string recordSetName; ScenarioContext.Current.TryGetValue("recordset", out recordSetName); var recordset = ScenarioContext.Current.Get<string>("recordset"); var length = new DsfRecordsetLengthActivity { RecordsetName = recordset, RecordsLength = ResultVariable }; TestStartNode = new FlowStep { Action = length }; ScenarioContext.Current.Add("activity", length); CurrentDl = shape.ToString(); TestData = data.ToString(); }
protected override void BuildDataList() { BuildShapeAndTestData(); List<ActivityDTO> fieldCollection; ScenarioContext.Current.TryGetValue("fieldCollection", out fieldCollection); var multiAssign = new DsfMultiAssignActivity(); TestStartNode = new FlowStep { Action = multiAssign }; foreach(var field in fieldCollection) { multiAssign.FieldsCollection.Add(field); } ScenarioContext.Current.Add("activity", multiAssign); }
protected override void BuildDataList() { BuildShapeAndTestData(); var create = new DsfPathCreate { OutputPath = ScenarioContext.Current.Get<string>(CommonSteps.DestinationHolder), Username = ScenarioContext.Current.Get<string>(CommonSteps.DestinationUsernameHolder).ResolveDomain(), Password = ScenarioContext.Current.Get<string>(CommonSteps.DestinationPasswordHolder), Overwrite = ScenarioContext.Current.Get<bool>(CommonSteps.OverwriteHolder), Result = ScenarioContext.Current.Get<string>(CommonSteps.ResultVariableHolder) }; TestStartNode = new FlowStep { Action = create }; ScenarioContext.Current.Add("activity", create); }