public override void Execute(object parameter)
        {
            // legacy static class...
            var test = NewTestMethodCommand.NewTestMethod(_vbe);

            if (test != null)
            {
                _model.Tests.Add(test);
            }
        }
Esempio n. 2
0
        public TestExplorerViewModel(VBE vbe,
                                     RubberduckParserState state,
                                     ITestEngine testEngine,
                                     TestExplorerModel model,
                                     IClipboardWriter clipboard,
                                     NewUnitTestModuleCommand newTestModuleCommand,
                                     NewTestMethodCommand newTestMethodCommand,
                                     IGeneralConfigService configService,
                                     IOperatingSystem operatingSystem)
        {
            _state      = state;
            _testEngine = testEngine;
            _testEngine.TestCompleted += TestEngineTestCompleted;
            _model           = model;
            _clipboard       = clipboard;
            _configService   = configService;
            _operatingSystem = operatingSystem;

            _navigateCommand = new NavigateCommand();

            _runAllTestsCommand = new RunAllTestsCommand(state, testEngine, model);
            _runAllTestsCommand.RunCompleted += RunCompleted;

            _addTestModuleCommand      = new AddTestModuleCommand(vbe, state, newTestModuleCommand);
            _addTestMethodCommand      = new AddTestMethodCommand(vbe, state, newTestMethodCommand);
            _addErrorTestMethodCommand = new AddTestMethodExpectedErrorCommand(vbe, state, newTestMethodCommand);

            _refreshCommand             = new DelegateCommand(ExecuteRefreshCommand, CanExecuteRefreshCommand);
            _repeatLastRunCommand       = new DelegateCommand(ExecuteRepeatLastRunCommand, CanExecuteRepeatLastRunCommand);
            _runNotExecutedTestsCommand = new DelegateCommand(ExecuteRunNotExecutedTestsCommand, CanExecuteRunNotExecutedTestsCommand);
            _runFailedTestsCommand      = new DelegateCommand(ExecuteRunFailedTestsCommand, CanExecuteRunFailedTestsCommand);
            _runPassedTestsCommand      = new DelegateCommand(ExecuteRunPassedTestsCommand, CanExecuteRunPassedTestsCommand);
            _runSelectedTestCommand     = new DelegateCommand(ExecuteSelectedTestCommand, CanExecuteSelectedTestCommand);

            _copyResultsCommand = new DelegateCommand(ExecuteCopyResultsCommand);

            _openTestSettingsCommand = new DelegateCommand(OpenSettings);

            _setOutcomeGroupingCommand = new DelegateCommand(param =>
            {
                GroupByOutcome  = (bool)param;
                GroupByLocation = !(bool)param;
            });

            _setLocationGroupingCommand = new DelegateCommand(param =>
            {
                GroupByLocation = (bool)param;
                GroupByOutcome  = !(bool)param;
            });
        }
 public AddTestMethodCommand(VBE vbe, RubberduckParserState state, NewTestMethodCommand command)
 {
     _vbe     = vbe;
     _command = command;
     _state   = state;
 }
 private void OnExplorerAddTestMethodButtonClick(object sender, EventArgs e)
 {
     NewTestMethodCommand.NewTestMethod(this.VBE);
     Synchronize();
 }