private void SetResponseCode(BaseTestCase baseTestCase) { HTTPTestCase httpTestCase = null; CommandTestCase commandTestCase = null; TestCaseOutputEventArgs testCaseOutputEventArgs; baseTestCase.CaseStatus = BaseTestCase.TestCaseStatus.FINISHED; InputFileName = InputFileName.Substring(InputFileName.IndexOf('\\') + 1); if (baseTestCase.TestCaseType == "http") { httpTestCase = (HTTPTestCase)baseTestCase; testCaseOutputEventArgs = new TestCaseOutputEventArgs(new TestCaseResult { Target = httpTestCase.Target, ProxyURL = httpTestCase.ProxyServer, ProxyType = (!string.IsNullOrEmpty(httpTestCase.ProxyServer) ? "Manual" : "Static"), InputJsonFileName = InputFileName, ExpectedStatusCode = httpTestCase.ExpectedResponseCode, ActualStatusCode = httpTestCase.ActualResponseCode, Result = (httpTestCase.ExpectedResponseCode == httpTestCase.ActualResponseCode) ? "Pass" : "Fail", Description = httpTestCase.Description }); } else { commandTestCase = (CommandTestCase)baseTestCase; testCaseOutputEventArgs = new TestCaseOutputEventArgs(new TestCaseResult { Target = commandTestCase.Target, InputJsonFileName = InputFileName, ExpectedStatusCode = commandTestCase.ExpectedResponseCode, ActualStatusCode = commandTestCase.ActualReturnCode, Result = (commandTestCase.ExpectedResponseCode == commandTestCase.ActualReturnCode) ? "Pass" : "Fail", Description = commandTestCase.Description }); } OnTestCaseOutputEventHandler(testCaseOutputEventArgs); Console.WriteLine("----------------------------------------------------------------------"); }
// runner array to track process? //private int TestC // todo: fancy tasks and stuff protected virtual void OnTestCaseOutputEventHandler(TestCaseOutputEventArgs e) { TestCaseOutputEventHandler?.Invoke(this, e); }