Exemplo n.º 1
0
        /// <summary>
        /// Starts the test run.
        /// </summary>
        private void StartTestRun()
        {
            _model = DataManager.Create(_harness);
            _model.Hook();

            DataContext = _model.Data;

            ScrollViewer sv = resultsTreeView.GetScrollHost();

            // Keep the current test visible in the tree view control
            _harness.TestClassStarting += (x, xe) =>
            {
                if (resultsTreeView != null)
                {
                    resultsTreeView.SelectItem(_model.GetClassModel(xe.TestClass));
                }
                ;
            };
            _harness.TestMethodStarting += (x, xe) =>
            {
                if (sv != null)
                {
                    sv.ScrollToBottom();
                }
            };
            _harness.TestMethodCompleted  += OnTestMethodCompleted;
            _harness.TestHarnessCompleted += OnTestHarnessCompleted;
            _harness.TestAssemblyStarting += OnTestAssemblyStarting;

            _harness.Run();
        }
Exemplo n.º 2
0
        public void Run(UnitTestSettings settings)
        {
            // Avoid having the Run method called twice
            if (_harness != null)
            {
                return;
            }

            _harness = settings.TestHarness;
            if (_harness == null)
            {
                throw new InvalidOperationException(Properties.UnitTestMessage.UnitTestSystem_Run_NoTestHarnessInSettings);
            }

            if (settings.TestService == null && !settings.TestServiceSetterCalled)
            {
                SetTestService(settings);
            }

            _harness.Settings              = settings;
            _harness.TestHarnessCompleted += (sender, args) => OnTestHarnessCompleted(args);

            if (settings.StartRunImmediately)
            {
                _harness.Run();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Starts the test run.
        /// </summary>
        private void StartTestRun()
        {
            //TagEditorHolder.Visibility = Visibility.Collapsed;
            //TestExecution.Visibility = Visibility.Visible;

            // Configure the Application Bar buttons.
            UIElement rootVisual = Application.Current.RootVisual;

            if (rootVisual is PhoneApplicationFrame)
            {
                IApplicationBar      appBar;
                PhoneApplicationPage mainPage = (((PhoneApplicationFrame)rootVisual).Content as PhoneApplicationPage);

                // The test project should not have an app bar configured
                // if so, replace it.

                appBar = new ApplicationBar();
                mainPage.ApplicationBar = appBar;
                appBar.IsMenuEnabled    = false;

                _emailButton           = new ApplicationBarIconButton();
                _emailButton.IconUri   = new Uri("/Toolkit.Content/appbar.feature.email.rest.png", UriKind.Relative);
                _emailButton.Text      = "email";
                _emailButton.Click    += OnEmailResultsButtonClick;
                _emailButton.IsEnabled = false;

                _saveButton           = new ApplicationBarIconButton();
                _saveButton.IconUri   = new Uri("/Toolkit.Content/appbar.save.rest.png", UriKind.Relative);
                _saveButton.Text      = "save";
                _saveButton.Click    += OnSaveResultsButtonClick;
                _saveButton.IsEnabled = false;


                appBar.Buttons.Add(_emailButton);
                appBar.Buttons.Add(_saveButton);
            }

            if (!(DataContext is TestRunData))
            {
                _model = DataManager.Create(_harness);
                _model.Hook();

                DataContext = _model.Data;

                _harness.TestHarnessCompleted += OnTestHarnessCompleted;
            }

            _harness.Run();
            RunningTestPanel.Visibility         = System.Windows.Visibility.Visible;
            RunningTestProgress.IsIndeterminate = true;
        }
        /// <summary>
        /// Starts the test run.
        /// </summary>
        private void StartTestRun()
        {
            if (!(DataContext is TestRunData))
            {
                _model = DataManager.Create(_harness);
                _model.Hook();

                DataContext = _model.Data;

                _slides.Add(SlideTestsRunning);
                _slides.MoveTo(SlideTestsRunning);

                _harness.TestHarnessCompleted += OnTestHarnessCompleted;
            }

            _harness.Run();
            RunOverview.Visibility = Visibility.Visible;
        }