コード例 #1
0
        private void HandleTestResult(TestCaseResult result, TestCase test, TestCaseView testView)
        {
            switch (result.Result)
            {
            case TestCaseResultCode.Success:
                testView.resultImage.color = Color.green;
                break;

            case TestCaseResultCode.Failure:
                testView.resultImage.color = Color.red;
                break;

            case TestCaseResultCode.Inconclusive:
                testView.resultImage.color = Color.yellow;
                break;

            case TestCaseResultCode.CannotArrange:
                testView.resultImage.color = Color.magenta;
                break;

            default:
                break;
            }

            if (!result.Details.IsNullOrEmpty())
            {
                testView.details.text = result.Details;
            }
        }
コード例 #2
0
        private void SetupTest(TestCase test, GameObject go)
        {
            TestCaseView testView = go.GetComponent <TestCaseView>();

            testView.ActButton.onClick.AddListener(delegate { OnTestClicked(test, go); });

            testView.ActButton.GetComponentInChildren <Text>().text = test.Description;

            testView.details.text = test.Details;
        }