private void AddToTestList(object sender, RoutedEventArgs e)
        {
            if (this.ProjectTreeView.SelectedItem is TestCaseProxy)
            {
                ExtendedTestCaseProxy testCase = new ExtendedTestCaseProxy(this.ProjectTreeView.SelectedItem as TestCaseProxy, Status.NotExecuted);
                ProjectProxy projectProxy = this.ProjectProxyList.Where(proj => proj.Areas.Any(a => a.ID == testCase.AreaID)).FirstOrDefault();
                if (projectProxy != null)
                {
                    AreaProxy areaProxy = projectProxy.Areas.Where(a => a.ID == testCase.AreaID).FirstOrDefault();
                    if (areaProxy != null)
                        areaProxy.TestCasesList.Remove(this.ProjectTreeView.SelectedItem as TestCaseProxy);
                }

                if (this.TestCasesList.Any(x => x.Id == testCase.Id) == false)
                    this.TestCasesList.Add(testCase);
            }
        }
예제 #2
0
        public static TestRunProxy TestRunModelToProxy(TestRun run)
        {
            TestRunProxy runProxy = new TestRunProxy();
            runProxy.ID = run.ID;
            runProxy.Name = run.Name;
            runProxy.CreatedBy = run.CreatedBy;
            runProxy.CreatedOn = run.CreatedOn;

            IEnumerable<TestComposite> compositeModel = new TestRunManager().GetCompositeByRunId(runProxy.ID);
            foreach (TestComposite comp in compositeModel)
            {
                ExtendedTestCaseProxy extendedTestCaseProxy = new ExtendedTestCaseProxy();
                extendedTestCaseProxy.Status = EnumUtil.ParseEnum<Status>(comp.TestCaseStatus);

                TestCase testCase = new TestManager().GetById(comp.TestCaseID);
                extendedTestCaseProxy.Id = testCase.ID;
                extendedTestCaseProxy.Title = testCase.Title;
                extendedTestCaseProxy.Priority = EnumUtil.ParseEnum<Priority>(testCase.Priority);
                extendedTestCaseProxy.Severity = EnumUtil.ParseEnum<Severity>(testCase.Severity);
                extendedTestCaseProxy.IsAutomated = testCase.IsAutomated;
                extendedTestCaseProxy.CreatedBy = testCase.CreatedBy;
                extendedTestCaseProxy.UpdatedBy = testCase.UpdatedBy;
                extendedTestCaseProxy.AreaID = testCase.AreaID;

                foreach (var item in new TestManager().GetStepDefinitionsById(testCase.ID))
                {
                    StepDefinitionProxy proxy = new StepDefinitionProxy();
                    proxy.Step = item.Step;
                    proxy.ExpectedResult = item.ExpectedResult;
                    proxy.ID = item.ID;
                    proxy.TestCaseID = item.TestCaseID;

                    extendedTestCaseProxy.StepDefinitionList.Add(proxy);
                }

                runProxy.TestCasesList.Add(extendedTestCaseProxy);
            }

            return runProxy;
        }
        private void SetCurrentTestCase(ExtendedTestCaseProxy testCaseProxy)
        {
            if(testCaseProxy != null)
            {
                this.TestCaseTitle.Text = testCaseProxy.Title;
                this.PriorityComboBox.SelectedIndex = (int)testCaseProxy.Priority;
                this.SeverityComboBox.SelectedIndex = (int)testCaseProxy.Severity;
                this.IsAutomatedCheckBox.IsChecked = testCaseProxy.IsAutomated;

                this.TestStepList.ItemsSource = testCaseProxy.StepDefinitionList;
            }
        }