public static ITestRun GetTestRunWithStatus(TestRunStatuses status, params string[] rules) { var workflow = new TestWorkflow(TestLabCollection.TestLabs.First()) { Name = "workflow 01" }; workflow.SetTestLab(TestLabCollection.TestLabs.First()); WorkflowCollection.Workflows.Add(workflow); var testRun = new TestRun { Name = "test run 03", Status = status }; testRun.SetWorkflow(workflow); TestRunQueue.TestRuns.Add(testRun); var taskId = 0; if (null != rules) { // 20150904 rules.ToList().ForEach(rule => TaskPool.Tasks.Add(new TestTask { Id = ++taskId, Rule = rule, WorkflowId = workflow.Id, TestRunId = testRun.Id })); } // rules.ToList().ForEach(rule => TaskPool.Tasks.Add(new TestTask (TestTaskRuntimeTypes.Powershell) { Id = ++taskId, Rule = rule, WorkflowId = workflow.Id, TestRunId = testRun.Id })); return(testRun); }
public static void GetAnotherTestRunWithStatus(TestRunStatuses status, ITestWorkflow workflow) { var testRun = new TestRun { Name = "test run the second", Status = status }; testRun.SetWorkflow(workflow); TestRunQueue.TestRuns.Add(testRun); }
public static ITestRun GetTestRunWithStatus(TestRunStatuses status) { var workflow = new TestWorkflow(TestLabCollection.TestLabs.First()) { Name = "workflow 01" }; workflow.SetTestLab(TestLabCollection.TestLabs.First()); WorkflowCollection.Workflows.Add(workflow); var testRun = new TestRun { Name = "test run 03", Status = status }; testRun.SetWorkflow(workflow); TestRunQueue.TestRuns.Add(testRun); return testRun; }
public static ITestRun GetTestRunWithStatus(TestRunStatuses status, params string[] rules) { var workflow = new TestWorkflow(TestLabCollection.TestLabs.First()) { Name = "workflow 01" }; workflow.SetTestLab(TestLabCollection.TestLabs.First()); WorkflowCollection.Workflows.Add(workflow); var testRun = new TestRun { Name = "test run 03", Status = status }; testRun.SetWorkflow(workflow); TestRunQueue.TestRuns.Add(testRun); var taskId = 0; if (null != rules) // 20150904 rules.ToList().ForEach(rule => TaskPool.Tasks.Add(new TestTask { Id = ++taskId, Rule = rule, WorkflowId = workflow.Id, TestRunId = testRun.Id })); // rules.ToList().ForEach(rule => TaskPool.Tasks.Add(new TestTask (TestTaskRuntimeTypes.Powershell) { Id = ++taskId, Rule = rule, WorkflowId = workflow.Id, TestRunId = testRun.Id })); return testRun; }
void SetWorkflow(ITestRunCommand testRunCommand, TestRun testRun) { testRun.SetWorkflow(WorkflowCollection.Workflows.First(wfl => wfl.Name == testRunCommand.WorkflowName)); TestLabCollection.TestLabs.First(testLab => testLab.Id == testRun.TestLabId).Status = TestLabStatuses.Busy; }