コード例 #1
0
        public void Setup()
        {
            TestCase = new TestCase("TestCase", "testcase.pmlobj");
            TestCase.Tests.Add("one").Result   = new TestResult(TimeSpan.FromSeconds(1));
            TestCase.Tests.Add("two").Result   = new TestResult(TimeSpan.FromSeconds(1), new PmlError("error"));
            TestCase.Tests.Add("three").Result = new TestResult(TimeSpan.FromSeconds(1));
            TestCase.Tests.Add("four");

            RunnerMock = new Mock <AsyncTestRunner>();
            RunnerMock
            .Setup(runner => runner.RunAsync(It.IsAny <IEnumerable <Test> >()))
            .Callback((IEnumerable <Test> tests) => Tests = tests);

            RunnerControl = new TestRunnerControl(Mock.Of <TestCaseProvider>(), RunnerMock.Object, Mock.Of <SettingsProvider>());
            TestSummary   = RunnerControl.FindControl <TestSummaryView>("TestSummary");
            TestList      = RunnerControl.FindControl <TestListView>("TestList");
            TestList.TestCases.Add(TestCase);

            Model = TestList.GetModel();

            foreach (var entry in Model.Entries)
            {
                var testEntry = entry as TestListTestEntry;
                if (testEntry != null)
                {
                    testEntry.IsSelected = testEntry.Test.Name == "two" || testEntry.Test.Name == "four";
                }
            }
        }
コード例 #2
0
 public void Setup()
 {
     TestCase = new TestCase("Test", "test.pmlobj");
     TestCase.Tests.Add("one");
     TestCase.Tests.Add("two");
     TestCase.Tests.Add("three");
     RunnerControl = new TestRunnerControl(Mock.Of <TestCaseProvider>(), Mock.Of <AsyncTestRunner>(), Mock.Of <SettingsProvider>());
     TestSummary   = RunnerControl.FindControl <TestSummaryView>("TestSummary");
     TestDetails   = RunnerControl.FindControl <TestDetailsView>("TestDetails");
     TestList      = RunnerControl.FindControl <TestListView>("TestList");
     TestList.TestCases.Add(TestCase);
     Model = TestList.GetModel();
 }