public Testcase(string testcaseName, TestcaseExecution execution) { this.TestcaseName = testcaseName; this.execution = execution; this.Logs = string.Empty; this.testcase = new List<Testcase>(); this.Status = TestcaseStatus.NotRun; }
public async Task<bool> Run() { this.Status = TestcaseStatus.Running; bool isPass = false; try { isPass = await this.execution(this); this.Status = isPass ? TestcaseStatus.Passed : TestcaseStatus.Failed; Logs = this.Status.ToString(); } catch (Exception ex) { isPass = false; this.Status = TestcaseStatus.Failed; Logs = ex.Message; } return isPass; }
public void Reset() { Logs = ""; this.Status = TestcaseStatus.NotRun; }