static Texture2D GetTestIcon(ValidationTestReport test) { if (test.TestState == TestState.Failed) { return(Icons.s_FailImg); } if (test.TestState == TestState.Running) { return(Icons.s_StopwatchImg); } if (test.TestState == TestState.Succeeded) { return(Icons.s_SuccessImg); } if (test.TestState == TestState.NotRun) { return(Icons.s_IgnoreImg); } if (test.TestState == TestState.NotImplementedYet) { return(Icons.s_IgnoreImg); } return(Icons.s_UnknownImg); }
public ReportRow(ValidationTestReport test, Action <ReportRow> onSelected = null) { Test = test; this.name = "reportRow"; var icon = new VisualElement(); icon.name = "icon"; icon.style.backgroundImage = GetTestIcon(test); Add(icon); var name = new Label(test.TestName); Add(name); RegisterCallback <MouseDownEvent>(evt => OnSelected(this)); if (onSelected != null) { OnSelected += onSelected; } }
void OnSelected(ValidationTestReport selected) { m_SelectedTest = selected; }
public void SelectRow(ValidationTestReport targetTest) { SelectRow(GetForTest(targetTest)); }
ReportRow GetForTest(ValidationTestReport targetTest) { return(TestList.Query <ReportRow>().ToList().Find(row => row.Test.TestName == targetTest.TestName)); }