/// <summary> /// Fetches the type of the execution. /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="environment"></param> /// <param name="errors">The errors.</param> /// <param name="update"></param> /// <returns></returns> private ForEachBootstrapTO FetchExecutionType(IDSFDataObject dataObject, IExecutionEnvironment environment, out ErrorResultTO errors, int update) { if (dataObject.IsDebugMode()) { var debugItem = new DebugItem(); AddDebugItem(new DebugItemStaticDataParams(ForEachType.GetDescription(), ""), debugItem); if (ForEachType == enForEachType.NumOfExecution && !string.IsNullOrEmpty(NumOfExections)) { AddDebugItem(new DebugEvalResult(NumOfExections, "Number", environment, update), debugItem); } if (ForEachType == enForEachType.InCSV && !string.IsNullOrEmpty(CsvIndexes)) { AddDebugItem(new DebugEvalResult(CsvIndexes, "Csv Indexes", environment, update), debugItem); } if (ForEachType == enForEachType.InRange && !string.IsNullOrEmpty(From)) { AddDebugItem(new DebugEvalResult(From, "From", environment, update), debugItem); } if (ForEachType == enForEachType.InRange && !string.IsNullOrEmpty(To)) { AddDebugItem(new DebugEvalResult(To, "To", environment, update), debugItem); } if (ForEachType == enForEachType.InRecordset && !string.IsNullOrEmpty(Recordset)) { AddDebugItem(new DebugEvalResult(ExecutionEnvironment.GetPositionColumnExpression(Recordset), "Recordset ", environment, update), debugItem); } _debugInputs.Add(debugItem); } var result = new ForEachBootstrapTO(ForEachType, From, To, CsvIndexes, NumOfExections, Recordset, environment, out errors, update); return(result); }
public void GivenVariable_ExecutionEnvironmentGetPositionColumnExpression_ShouldReturnSameVariable() { Assert.IsNotNull(_environment); var positionColumnExpression = ExecutionEnvironment.GetPositionColumnExpression("[[rec]]"); Assert.IsNotNull(positionColumnExpression); Assert.AreEqual("[[rec]]", positionColumnExpression); }
public void GivenRecSet_ExecutionEnvironmentGetPositionColumnExpression_ShouldReturn() { Assert.IsNotNull(_environment); var positionColumnExpression = ExecutionEnvironment.GetPositionColumnExpression("[[rec()]]"); Assert.IsNotNull(positionColumnExpression); Assert.IsTrue(positionColumnExpression.Contains("rec(*)")); }