예제 #1
0
        private async void RunTestItem(TestItemViewModel target, bool isCovering, bool isDebugging, bool isCoverAfterBuild = false)
        {
            if (target == null)
            {
                return;
            }

            var canContinue = true;

            if (_options.IsAutoBuildEnabled && !isCoverAfterBuild)
            {
                try
                {
                    _suppressAutoLoadAndRun = true;
                    canContinue             = await _editorContext.TryBuildSolutionAsync();

                    if (canContinue)
                    {
                        await LoadSolution();
                    }
                }
                finally
                {
                    _suppressAutoLoadAndRun = false;
                }
            }

            if (canContinue)
            {
                var testRun = _testRunner.RunTestsAsync(target.CodeItem, isCovering, isDebugging);
                target.Source.ScheduleAll();
                await testRun;
            }
        }
        private void RunTestItem(TestItemViewModel target, bool isCovering, bool isDebugging)
        {
            if (target == null)
            {
                return;
            }

            _testRunner.RunTestsAsync(target.CodeItem, isCovering, isDebugging);
            target.Source.ScheduleAll();
        }
        private void NavigateToTestItem(TestItemViewModel testItem)
        {
            if (testItem == null)
            {
                return;
            }

            switch (testItem.CodeItem.Kind)
            {
            case CodeItemKind.Class:
                _editorContext.NavigateToClass(testItem.CodeItem.GetParent <TestProject>().Name, testItem.CodeItem.FullName);
                break;

            case CodeItemKind.Method:
                _editorContext.NavigateToMethod(testItem.CodeItem.GetParent <TestProject>().Name, testItem.Parent.CodeItem.FullName, testItem.CodeItem.Name);
                break;

            case CodeItemKind.Data:
                testItem = testItem.Parent;
                goto case CodeItemKind.Method;
            }
        }
예제 #4
0
 private void RunTestItem(TestItemViewModel target, bool isCovering, bool isDebugging)
 {
     _testRunner.RunTestsAsync(target.CodeItem, isCovering, isDebugging);
     target.ScheduleAll();
 }