public void find_test_recursive() { var test = new Test("some name"); Suite top = new Suite("top").Add(x => { x.Suite("child").Add(o => { o.Suite("grandchild").AddTest(test); }); }); top.FindTest("child/grandchild/some name").ShouldBeTheSameAs(test); }
public void find_test_recursive() { var test = new Test("some name"); Suite top = new Suite("top").Add(x => { x.Suite("child").Add(o => { o.Suite("grandchild").AddTest(test); }); }); top.FindTest("child/grandchild/some name").ShouldBeTheSameAs(test); }
protected override void beforeEach() { suite = StoryTeller.Testing.DataMother.BuildHierarchy(@" t1,Success t2,Success t3,Success "); test1 = suite.FindTest("t1"); test2 = suite.FindTest("t2"); test3 = suite.FindTest("t3"); Services.Inject(suite); driver1 = MockRepository.GenerateMock <ITestLineDriver>(); driver2 = MockRepository.GenerateMock <ITestLineDriver>(); driver3 = MockRepository.GenerateMock <ITestLineDriver>(); MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test1), Is.Anything()).Return( driver1); MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test2), Is.Anything()).Return( driver2); MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test3), Is.Anything()).Return( driver3); MockFor <ITestService>().Expect(x => x.GetStatus(test1)).Return(TestState.Queued); MockFor <ITestExplorer>().Expect(x => x.IconFor(test1)).Return(Icon.Pending); MockFor <ITestService>().Expect(x => x.GetStatus(test2)).Return(TestState.NotQueued); MockFor <ITestExplorer>().Expect(x => x.IconFor(test2)).Return(Icon.Success); MockFor <ITestService>().Expect(x => x.GetStatus(test3)).Return(TestState.NotQueued); MockFor <ITestExplorer>().Expect(x => x.IconFor(test3)).Return(Icon.Failed); ClassUnderTest.Activate(null); }