Пример #1
0
 protected override void fixturesAre(FixtureRegistry registry)
 {
     registry.AddFixture <SentenceFixture>();
     registry.AddFixture <SetsFixture>();
     registry.AddFixture <TableFixture>();
     registry.AddFixture <MathFixture>();
 }
        public void add_fixture_directly()
        {
            registry.AddFixture <SomethingFixture>();

            context.LoadFixture("Something", new StubTestPart());

            context.FindGrammar("DoSomething").ShouldBeOfType <ActionMethodGrammar>();
        }
        public void SetUp()
        {
            var container = new Container();
            var registry = new FixtureRegistry();
            registry.AddFixture<FixtureWithHiddenGrammarsFixture>();
            registry.AddFixturesToContainer(container);
            var context = new TestContext(container);

            var observer = MockRepository.GenerateMock<IFixtureObserver>();
            var builder = new LibraryBuilder(observer, new CompositeFilter<Type>(), new ObjectConverter());

            builder.Build(context);

            library = builder.Library;
        }
Пример #4
0
        public void should_apply_the_extender_to_fixtures()
        {
            var fixtureRegistry = new FixtureRegistry();

            fixtureRegistry.AddFixture <FakeFixture>();
            fixtureRegistry.RegisterServices(r =>
            {
                r.For <IExtender <FakeFixture> >().AddInstances(x =>
                {
                    x.Type <FakeExtenderFixture>();
                    x.Type <FakeExtender2Fixture>();
                });
            });

            var theFixture = fixtureRegistry.BuildContainer().GetInstance <FakeFixture>();

            var list = new List <string>();

            theFixture.ForEachGrammar((name, g) => list.Add(name));

            list.ShouldHaveTheSameElementsAs("Go", "Go2", "Go3", "Go4", "Go5", "Go6");
        }
Пример #5
0
 protected override void fixturesAre(FixtureRegistry registry)
 {
     registry.AddFixture <ParagraphGrammarFixture>();
 }
Пример #6
0
 protected override void fixturesAre(FixtureRegistry registry)
 {
     registry.AddFixture <SentenceGrammarFixture>();
 }
Пример #7
0
 protected override void fixturesAre(FixtureRegistry registry)
 {
     registry.AddFixture <EmbeddedFixture>();
 }
Пример #8
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));
        }
Пример #9
0
        private void fixturesShouldBe(params string[] names)
        {
            var container = new Container();
            var registry = new FixtureRegistry();
            registry.AddFixture<OhioFixture>();
            registry.AddFixture<WisconsinFixture>();
            registry.AddFixture<IllinoisFixture>();
            registry.AddFixture<NorthFixture>();
            registry.AddFixture<SouthFixture>();

            registry.AddFixturesToContainer(container);

            var builder = new LibraryBuilder(new NulloFixtureObserver(),
                                             project.CurrentFixtureFilter().CreateTypeFilter(), new ObjectConverter());
            var library = builder.Build(new TestContext(container));

            Array.Sort(names);

            library.ActiveFixtures.Select(x => x.Name).ShouldHaveTheSameElementsAs(names);
        }
Пример #10
0
 public override void RegisterFixtures(FixtureRegistry registry)
 {
     registry.AddFixture <NameScreenFixture>();
 }