Exemplo n.º 1
0
        public void visit_a_fixture_that_blows_up_in_its_constructor()
        {
            var context = new TestContext(x => x.AddFixture<FixtureThatBlowsUpFixture>());

            var visitor = MockRepository.GenerateMock<IFixtureVisitor>();

            context.VisitFixtures(visitor);

            visitor.AssertWasCalled(x => x.LogFixtureFailure("FixtureThatBlowsUp", null),
                                    x => x.Constraints(Is.Equal("ThatBlowsUp"), Is.TypeOf<StructureMapException>()));
        }
Exemplo n.º 2
0
        public void visit_a_successful_fixture()
        {
            var context = new TestContext(x =>
            {
                x.AddFixture<SomethingFixture>();
                x.AddFixture<SomethingElseFixture>();
            });

            var visitor = MockRepository.GenerateMock<IFixtureVisitor>();

            context.VisitFixtures(visitor);

            visitor.AssertWasCalled(x => x.ReadFixture(null, null),
                                    x => x.Constraints(Is.Equal("Something"), Is.TypeOf<SomethingFixture>()));
            visitor.AssertWasCalled(x => x.ReadFixture(null, null),
                                    x => x.Constraints(Is.Equal("TheSomethingElse"), Is.TypeOf<SomethingElseFixture>()));
        }
Exemplo n.º 3
0
        public void set_the_total_number_of_fixtures_on_the_visitor()
        {
            var context = new TestContext(x =>
            {
                x.AddFixture<SomethingFixture>();
                x.AddFixture<SomethingElseFixture>();
            });

            var visitor = MockRepository.GenerateMock<IFixtureVisitor>();

            context.VisitFixtures(visitor);

            visitor.AssertWasCalled(x => x.FixtureCount = 2);
        }