Exemplo n.º 1
0
        // sets testing parameters
        //   note:
        //      The testing parameters does not interfere with the execution ones.
        private void SetTestingParameters(Executable executable)
        {
            int i = 0;

            foreach (var param in executable.Compilable.GetRoot().ExplicitParams)
            {
                var argument = executable.Arguments.Where(a => a.ParamName == param.Name).FirstOrDefault();
                if (argument == null)
                {
                    continue;
                }

                if (argument.DT.IsNotInliner())
                {
                    if (!argument.DT.IsTable())
                    {
                        argument.TestValue = Mapping.BuildTestValue(_parameters.Rows[i].Cells[2].Value.ToString(), argument.DataType);
                    }
                    else
                    {
                        var tab = FindTab(param.Name);
                        if (tab != null)
                        {
                            DataGridView grid = (DataGridView)tab.Controls[0];
                            argument.TestValue = Designer.ToView(grid.DataSource);
                        }
                    }
                }
                ++i;
            }
        }