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 WhenSendingTestRunAsJson(string testWorkflowName, TestRunStatuses status) { var testRunCommand = new TestRunCommand { WorkflowName = testWorkflowName, Status = status }; WhenSendingTestRunAsJson(testWorkflowName, UrlList.TestRunsControlPoint_absPath, testRunCommand); }
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; }
TestRunCommand WhenSendingTestRunAsJson(string testWorkflowName, TestRunStatuses status, string alternativeUrl, ITestRunCommand testRunCommand) { var testRun = new TestRun(); (testRun as TestRun).SetWorkflow(WorkflowCollection.Workflows.First(wfl => wfl.Name == testWorkflowName)); if (null == testRunCommand) _response = _browser.Get(alternativeUrl, with => { // with.JsonBody(testRunCommand); with.Accept("application/json"); }); else _response = _browser.Get(alternativeUrl, with => { with.JsonBody(testRunCommand); with.Accept("application/json"); }); Xunit.Assert.Equal(HttpStatusCode.Created, _response.StatusCode); return _response.Body.DeserializeJson<TestRunCommand>(); }
public bool CreateTestRun(string workflowName, TestRunStatuses status, string name) { Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).1"); var testRunCommand = new TestRunCommand { TestRunName = name, Status = status, WorkflowName = workflowName }; Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).2"); var creatingTestRunResponse = _restTemplate.PostForMessage(UrlList.TestRunsControlPoint_absPath, testRunCommand); Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).3 creatingTestRunResponse is null? {0}", null == creatingTestRunResponse); // 20150316 if (null == creatingTestRunResponse) throw new Exception("Failed to create a test run."); return HttpStatusCode.Created == creatingTestRunResponse.StatusCode; }
public virtual bool CreateTestRun(string workflowName, TestRunStatuses status, string name) { Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).1"); var testRunCommand = new TestRunCommand { TestRunName = name, Status = status, WorkflowName = workflowName }; Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).2"); var creatingTestRunResponse = _restTemplate.PostForMessage(UrlList.TestRunsControlPoint_absPath, testRunCommand); Trace.TraceInformation("CreateTestRun(string workflowName, TestRunStatuses status, string name).3 creatingTestRunResponse is null? {0}", null == creatingTestRunResponse); if (null == creatingTestRunResponse) { throw new Exception("Failed to create a test run."); } return(HttpStatusCode.Created == creatingTestRunResponse.StatusCode); }
TestRunCommand WhenSendingTestRunAsJson(string testWorkflowName, TestRunStatuses status, string alternativeUrl, ITestRunCommand testRunCommand) { var testRun = new TestRun(); (testRun as TestRun).SetWorkflow(WorkflowCollection.Workflows.First(wfl => wfl.Name == testWorkflowName)); if (null == testRunCommand) { _response = _browser.Get(alternativeUrl, with => { // with.JsonBody(testRunCommand); with.Accept("application/json"); }); } else { _response = _browser.Get(alternativeUrl, with => { with.JsonBody(testRunCommand); with.Accept("application/json"); }); } Xunit.Assert.Equal(HttpStatusCode.Created, _response.StatusCode); return(_response.Body.DeserializeJson <TestRunCommand>()); }
TestRunCommand WHEN_sending_testRun_as_json(string testWorkflowName, TestRunStatuses status, string alternativeUrl, ITestRunCommand testRunCommand) { var testRun = new TestRun(); // var testRunCommand = new TestRunCommand { WorkflowName = testWorkflowName, Status = status }; (testRun as TestRun).SetWorkflow(WorkflowCollection.Workflows.First(wfl => wfl.Name == testWorkflowName)); if (null == testRunCommand) _response = _browser.Post(alternativeUrl, with => { // with.JsonBody(testRunCommand); with.Accept("application/json"); }); else _response = _browser.Post(alternativeUrl, with => { with.JsonBody(testRunCommand); with.Accept("application/json"); }); return _response.Body.DeserializeJson<TestRunCommand>(); }
TestRunCommand WHEN_sending_testRun_as_json(string testWorkflowName, TestRunStatuses status) { // var testRun = new TestRun(); // var testRunCommand = new TestRunCommand { WorkflowName = testWorkflowName, Status = status }; // (testRun as TestRun).SetWorkflow(WorkflowCollection.Workflows.First(wfl => wfl.Name == testWorkflowName)); // _response = _browser.Post(UrlList.TestRunsControlPoint_absPath, with => { // with.JsonBody(testRunCommand); // with.Accept("application/json"); // }); // return _response.Body.DeserializeJson<TestRunCommand>(); var testRunCommand = new TestRunCommand { WorkflowName = testWorkflowName, Status = status }; return WHEN_sending_testRun_as_json(testWorkflowName, status, UrlList.TestRunsControlPoint_absPath, testRunCommand); }
public static ITestRun GetTestRunWithStatus(TestRunStatuses status) { return GetTestRunWithStatus(status, "aaa_01"); }
ITestRun getTestRunWithStatus(TestRunStatuses status) { return getTestRunWithStatus(status, "aaa_01"); }
ITestRun getTestRunWithStatus(TestRunStatuses status, params string[] rules) { return TestFactory.GetTestRunWithStatus(status, rules); }
public static ITestRun GetTestRunWithStatus(TestRunStatuses status) { return(GetTestRunWithStatus(status, "aaa_01")); }
ITestRun getTestRunWithStatus(TestRunStatuses status) { return(getTestRunWithStatus(status, "aaa_01")); }
ITestRun getTestRunWithStatus(TestRunStatuses status, params string[] rules) { return(TestFactory.GetTestRunWithStatus(status, rules)); }
ITestRun getTestRunWithStatus(TestRunStatuses status) { return TestFactory.GetTestRunWithStatus(status); }