Ejemplo n.º 1
0
        public void ShowTest(Test test)
        {
            foreach (IViewWithDataContext view in regionManager.Regions[Regions.WorkspaceViewRegion].Views)
            {
                ITestMainShellViewModel mainShellViewModel = view.DataContext as ITestMainShellViewModel;

                if (mainShellViewModel == null)
                    continue;

                if (mainShellViewModel.Test.Id == test.Id)
                {
                    //mainShellViewModel.
                    mainShellViewModel.Refresh();
                    //regionManager.Regions[Regions.WorkspaceViewRegion].Remove(view);
                    //regionManager.Regions[Regions.WorkspaceViewRegion].AddAndActivate(view);
                    return;
                }

            }

            IViewWithDataContext testMainShellView = testMainShellViewFactory.Create();
            ITestMainShellViewModel testMainShellViewModel = testMainShellViewModelFactory.Create(test);

            testMainShellView.DataContext = testMainShellViewModel;

            regionManager.Regions[Regions.WorkspaceViewRegion].AddAndActivate(testMainShellView);
        }
Ejemplo n.º 2
0
        public IfOperationViewModel(Test test, IEventAggregator eventAggregator)
        {
            this.test = test;
            AddToTestCommand = new DelegateCommand(ExecuteAddToTestCommand);

            addTestItemEvent = eventAggregator.GetEvent<AddTestItemEvent>();
        }
Ejemplo n.º 3
0
        public TestShellViewModel(Test test, ITestDetailsViewModelFactory testDetailsViewModelFactory,
            ITestOperationsViewModelFactory testOperationsViewModelFactory)
        {
            this.testDetailsViewModelFactory = testDetailsViewModelFactory;
            this.testOperationsViewModelFactory = testOperationsViewModelFactory;

            TestDetailsViewModel = testDetailsViewModelFactory.Create(test);
            TestOperationsViewModel = testOperationsViewModelFactory.Create(test);
        }
Ejemplo n.º 4
0
        public void Start(Test test)
        {
            trainingMainWindow = trainingMainWindowFactory.Create();
            ITrainingMainViewModel trainingMainViewModel = trainingMainViewModelFactory.Create(test);

            trainingMainWindow.DataContext = trainingMainViewModel;

            trainingMainWindow.Show();

            appController.MainWindow.Minimize();
        }
Ejemplo n.º 5
0
        public static string GetScreenshotsFolder(Test test)
        {
            string screenshotsFolder = Path.Combine(
                ProjectSuiteManager.GetProjectFolder(test.Project),
                test.Project.TestsFolder,
                "Screenshots",
                test.Name);

            Directory.CreateDirectory(screenshotsFolder);

            return screenshotsFolder;
        }
 public TestScreenshotsViewModel(Test test)
 {
     Screenshots = test.TestItems.Where(t => t.HasScreenshot)
         .Select(t => t.Screenshot).ToArray();
 }