Пример #1
0
        public void calls_listener_end_section()
        {
            var context  = new TestContext(x => x.AddFixture <MathFixture>());
            var listener = MockRepository.GenerateMock <ITestObserver>();

            listener.Expect(x => x.CanContinue(null)).Return(true).IgnoreArguments().Repeat.Any();

            context.Listener = listener;


            var section = new Section("Math");

            context.CallOn <ITestVisitor>(x => x.StartSection(section));
            context.CallOn <ITestVisitor>(x => x.EndSection(section));

            listener.AssertWasCalled(x => x.FinishSection(section));
        }
Пример #2
0
        public void calls_listener_start_section()
        {
            var container = new Container();
            var registry = new FixtureRegistry();
            registry.AddFixture<MathFixture>();
            registry.AddFixturesToContainer(container);

            var context = new TestContext(container);
            var listener = MockRepository.GenerateMock<ITestObserver>();
            context.Listener = listener;

            listener.Expect(x => x.CanContinue(null)).Return(true).IgnoreArguments().Repeat.Any();

            var section = new Section("Math");
            context.CallOn<ITestVisitor>(x => x.StartSection(section));

            listener.AssertWasCalled(x => x.StartSection(section));
        }
Пример #3
0
        public void calls_listener_end_section()
        {
            var context = new TestContext();

            var listener = MockRepository.GenerateMock<ITestObserver>();

            listener.Expect(x => x.CanContinue(null)).Return(true).IgnoreArguments().Repeat.Any();

            context.Listener = listener;

            var section = new Section("Math");
            context.CallOn<ITestVisitor>(x => x.StartSection(section));
            context.CallOn<ITestVisitor>(x => x.EndSection(section));

            listener.AssertWasCalled(x => x.FinishSection(section));
        }