コード例 #1
0
        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);
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 void OnSelected(ValidationTestReport selected)
 {
     m_SelectedTest = selected;
 }
コード例 #4
0
 public void SelectRow(ValidationTestReport targetTest)
 {
     SelectRow(GetForTest(targetTest));
 }
コード例 #5
0
 ReportRow GetForTest(ValidationTestReport targetTest)
 {
     return(TestList.Query <ReportRow>().ToList().Find(row => row.Test.TestName == targetTest.TestName));
 }