예제 #1
0
        public void LoadData()
        {
            var testListBuilder = new TestListBuilder();
            var allTests        = testListBuilder.BuildTestsList();

            foreach (var test in allTests)
            {
                AllTests.Add(new TestViewModel(test));
            }
        }
예제 #2
0
        public void WriteResult(TestMethod test, TestResult result)
        {
            var gridItem     = FindItem(AllTests, test);
            var playListItem = FindItem(_playList, test);

            if (gridItem == null)
            {
                var item = new TestExplorerItem(test, result);
                AllTests.Add(item);
                gridItem = FindItem(AllTests, test);
            }

            gridItem.SetResult(result);
            playListItem.SetResult(result);

            UpdateProgress();
            testOutputGridView.Refresh();
        }
        /// <summary>
        /// Derived classes call this method to add subtests associated
        /// with this test group. The implementation will add the
        /// <see cref="ISubTest"/> objects to the <see cref="AdvancedTestGroup.AllTests"/>
        /// field.
        /// </summary>
        /// <param name="subTest"></param>
        protected void AddSubTest(ISubTest subTest)
        {
            foreach (ISubTest sub in AllTests.Values)
            {
                bool found = false;
                if (sub.Name == subTest.Name)
                {
                    found = true;
                }

                if (found)
                {
                    throw new ApplicationException("Cannot have two subtests with the same name.");
                }
            }

            AllTests.Add(subTest, subTest);

            this.AddTest(subTest.Name, subTest.Description);
        }