/// <summary> /// Initialize interface with default data. /// </summary> /// <param name="result"></param> public void InitializeData(Items.BaseItem result) { var res = result as Items.TestResult; if (null == res) { throw new ArgumentException("Invalid argument type."); } var isExecuted = res.IsExecuted; lblAsserts.Visible = isExecuted; lblTime.Visible = isExecuted; lblAssertsCap.Visible = isExecuted; lblTimeCap.Visible = isExecuted; if (isExecuted) { lblAsserts.Text = res.Asserts.Value.ToString(); lblTime.Text = res.Time; } lblExecuted.Text = res.IsExecuted.ToString(); lblName.Text = res.Name; lblresult.Text = res.TestResultValue.ToString(); lblresult.ForeColor = (res.TestResultValue == Items.TestResultsEnum.Error || res.TestResultValue == Items.TestResultsEnum.Failure || res.TestResultValue == Items.TestResultsEnum.Invalid) ? Color.Red : Color.Black; }
public void InitializeData(Items.BaseItem result) { var res = result as Items.TestCase; if (null == res) { throw new Exception("Invalid argument type."); } compTestResult.InitializeData(res); txtMessage.Lines = res.Message.Split(new[] { '\r', '\n' }); txtStackTrace.Lines = res.StackTrace.Split(new[] { '\r', '\n' }); }