コード例 #1
0
        private void StartNextTest()
        {
            // Start next test if group is idle
            if (_activeTestGroup != null && _activeTestGroup.Idle)
            {
                var activeTest = _activeTestGroup.StartNextTest();
                if (activeTest == null)
                {
                    _activeTestGroup = null;
                }
                else
                {
                    _output.Started(activeTest);
                    _elapsed = 0f;
                    activeTest.Execute.Invoke();
                }
            }

            // If we have no group, try to start the next group
            if (_activeTestGroup == null)
            {
                var runOutOfTests = !StartNewTestGroup();
                if (runOutOfTests)
                {
                    _runningTests = false;
                    _output.CompletedAllTests();
                }
            }
        }
コード例 #2
0
        private bool StartNewTestGroup()
        {
            var next = _tests.Count > 0 ? _tests.Dequeue() : null;

            if (next == null)
            {
                return(false);
            }

            var group = new RuntimeTestGroup(this, next, _output);

            _activeTestGroup = group;
            _output.Started(group);
            TestCases.Add(group);
            return(true);
        }
コード例 #3
0
        public void Update()
        {
            if (_runningTests)
            {
                StartNextTest();
                AbortExpiredTest();
                return;
            }

            if (RunTests)
            {
                RunTests = false;
                _output.Reset();
                _runningTests = true;
                _tests.Clear();
                _activeTestGroup = null;
                _allTests.ForEach(i => _tests.Enqueue(i));
                TestCases.Clear();
            }
        }