public void GenerateScenario() { CTestContainer container = new CTestContainer(); container.description = "Test container"; for (int testIndex = 1; testIndex <= 3; testIndex++) { CTest test = new CTest("Test_1." + testIndex, "Test descriptor #" + testIndex); for (int stepIndex = 1; stepIndex < 2; stepIndex++) { string title = "Step " + testIndex + "." + stepIndex; CStep step = new CStep( title, "Action description for " + title, "Check description for " + title ); for (int actionIndex = 1; actionIndex < 10; actionIndex++) { CInstruction action = new CInstrForce(); CVariableBool var = new CVariableBool("Var" + actionIndex, "Section1/ENV", "/path/to/application" + actionIndex, "true"); action.data = var; step.actions.Add(action); } for (int checkIndex = 1; checkIndex < 10; checkIndex++) { CInstruction action = new CInstrTest(); CVariableBool var = new CVariableBool("Var" + checkIndex, "Section2/ENV", "/path/to/application" + checkIndex, "true"); action.data = var; step.checks.Add(action); } test.Add(step); } container.Add(test); } string URIFilename = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + Path.DirectorySeparatorChar + "templates" + Path.DirectorySeparatorChar + "ST-TestStand4" + Path.DirectorySeparatorChar; Uri uri = new Uri(URIFilename); TestStandGen.TestStandGen.genSequence(container, "C:\\macros_alstom\\test\\genTest.seq", uri.LocalPath); Assert.IsTrue(true); }
private CTest parseAsTest(string title) { logger.Debug(String.Format("Extracting columns for action table.")); Excel.ListColumns lcActionsTableColumns = loActionsTable.ListColumns; tableStructure = checkAndDetermineTablecolumns(lcActionsTableColumns); object[,] actionsValues = preloadTable(this.actionTableName); logger.Debug(String.Format("Extracting columns for checks table.")); Excel.ListColumns lcChecksTableColumns = loChecksTable.ListColumns; object[,] checksValues = preloadTable(this.checkTableName); CTest parseSingleTest = new CTest(title, "Description"); logger.Debug(String.Format("Creating Test : {0}", parseSingleTest.ToString())); //''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' //' Writing inputs //''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' logger.Debug(String.Format("Found {0} Excel columns to process.", lcActionsTableColumns.Count)); for (int CurrentColumn = tableStructure.FirstColumnIndex; CurrentColumn < lcActionsTableColumns.Count; CurrentColumn++) { logger.Info(String.Format("Processing Column {0}.", lcActionsTableColumns[CurrentColumn+1].Name)); CStep o_step = new CStep(lcActionsTableColumns[CurrentColumn+1].Name+" : Title retrieval " + getComment(), "Action comment retrieval " + getComment(), "Checks comment retrieval " + getComment()); logger.Debug(String.Format("Processing Actions table.")); fillWithActions(o_step, TableTypes.TABLE_ACTIONS, loActionsTable, actionsValues, CurrentColumn); logger.Debug(String.Format("Processing Timer table.")); addTempoIfExists(o_step, loActionsTable, CurrentColumn); logger.Debug(String.Format("Processing Checks table.")); fillWithActions(o_step, TableTypes.TABLE_CHECKS, loChecksTable, checksValues, CurrentColumn); logger.Debug(String.Format("Adding step to results.")); parseSingleTest.Add(o_step); } return parseSingleTest; }