示例#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);
        }
        public IfOperationViewModel(Test test, IEventAggregator eventAggregator)
        {
            this.test = test;
            AddToTestCommand = new DelegateCommand(ExecuteAddToTestCommand);

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

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

            trainingMainWindow.DataContext = trainingMainViewModel;

            trainingMainWindow.Show();

            appController.MainWindow.Minimize();
        }
示例#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();
 }