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"; } } }
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(); }
public void Setup() { TestCases = new List <TestCase>(); var first = new TestCase("Foo", "foo.pmlobj"); first.Tests.Add("one"); first.Tests.Add("two"); TestCases.Add(first); var second = new TestCase("Bar", "bar.pmlobj"); second.Tests.Add("three"); second.Tests.Add("four"); second.Tests.Add("five"); TestCases.Add(second); ProviderMock = new Mock <TestCaseProvider>(); ProviderMock.Setup(provider => provider.GetTestCases()).Returns(TestCases); RunnerControl = new TestRunnerControl(ProviderMock.Object, Mock.Of <AsyncTestRunner>(), Mock.Of <SettingsProvider>()); TestList = RunnerControl.FindControl <TestListView>("TestList"); }