private void SetChart(Tests.Test t) { chart1.Series[0].Points.Clear(); chart1.Series[0].Points.AddXY("总测试用例数量", t.resultInfo.totalCase); //添加数据 chart1.Series[0].Points.AddXY("成功用例数量", t.resultInfo.successCase); //添加数据 chart1.Series[0].Points.AddXY("失败用例数量", t.resultInfo.failCase); //添加数据 }
private Test.Tests.Test GetTestClass(string _testName, string _testMethod, string _testVersion) { MyTestName myTestName = (MyTestName)Enum.Parse(typeof(MyTestName), _testName); MyTestMethod myTestMethod = (MyTestMethod)Enum.Parse(typeof(MyTestMethod), _testMethod); MyTestVersion myTestVersion = (MyTestVersion)Enum.Parse(typeof(MyTestVersion), _testVersion); Test.Tests.Test resultTest = t[(int)myTestName, (int)myTestMethod, (int)myTestVersion]; return(resultTest); }
//将测试与图表显示代码抽象为该函数 //四个参数分别是总数量,成功数量,失败数量以及测试的类 private void TestTheTest(int _totalCase, int _successCase, int _failCase, Test.Tests.Test _test) { _test.StartTest(); MessageBox.Show("测试已经完成"); _test.resultInfo.totalCase = _totalCase; _test.resultInfo.successCase = _successCase; _test.resultInfo.failCase = _failCase; SetChart(_test); }
private void TestTheTest(Test.Tests.Test _test) { _test.StartTest(); MessageBox.Show("测试已经完成"); SetChart(_test); }