protected override void fixturesAre(FixtureRegistry registry) { registry.AddFixture <SentenceFixture>(); registry.AddFixture <SetsFixture>(); registry.AddFixture <TableFixture>(); registry.AddFixture <MathFixture>(); }
public void SetUp() { var registry = new FixtureRegistry(); registry.AliasFixture<ExampleFixture>("Example"); registry.AliasFixture<ArithmeticFixture>("Arithmetic"); var runner = new TestRunner(registry); test = runner.CreateExample(); }
public void SetUp() { var builder = new LibraryBuilder(new NulloFixtureObserver(), new CompositeFilter <Type>()); var registry = new FixtureRegistry(); registry.AddFixturesFromAssemblyContaining <SetUserAction>(); var container = registry.BuildContainer(); var context = new TestContext(container); library = builder.Build(context); }
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; }
public FixtureLibrary StartSystem(FixtureAssembly fixtureAssembly, MarshalByRefObject remotePublisher) { _publisher = (IEventPublisher)remotePublisher; var observer = new FixtureObserver(_publisher); // TODO -- if fails, do a Thread.Sleep and try again _system = fixtureAssembly.System; _lifecycle = new SystemLifecycle(_system); // TODO -- make this be async observer.RecordStatus("Setting up the environment"); _lifecycle.StartApplication(); try { var registry = new FixtureRegistry(); _system.RegisterFixtures(registry); var container = registry.BuildContainer(); var library = TestRunnerBuilder.BuildLibrary(_lifecycle, observer, container, fixtureAssembly.Filter.CreateTypeFilter()); var containerSource = new FixtureContainerSource(container); _runner = new TestRunner(_lifecycle, library, containerSource); if (_listener != null) { _runner.Listener = _listener; } return(library); } catch (TestEngineFailureException) { throw; } catch (Exception e) { throw new TestEngineFailureException(e.ToString()); } }
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"); }
protected abstract void fixturesAre(FixtureRegistry registry);
protected override void fixturesAre(FixtureRegistry registry) { registry.AddFixture <EmbeddedFixture>(); }
public void SetUp() { var builder = new LibraryBuilder(new NulloFixtureObserver(), new CompositeFilter<Type>()); var registry = new FixtureRegistry(); registry.AddFixturesFromAssemblyContaining<SetUserAction>(); var container = registry.BuildContainer(); var context = new TestContext(container); library = builder.Build(context); }
public FixtureLibrary StartSystem(FixtureAssembly fixtureAssembly, MarshalByRefObject remotePublisher) { _publisher = (IEventPublisher)remotePublisher; var observer = new FixtureObserver(_publisher); // TODO -- if fails, do a Thread.Sleep and try again _system = fixtureAssembly.System; _lifecycle = new SystemLifecycle(_system); // TODO -- make this be async observer.RecordStatus("Setting up the environment"); _lifecycle.StartApplication(); try { var container = TestRunnerBuilder.BuildFixtureContainer(_system); var registry = new FixtureRegistry(); _system.RegisterFixtures(registry); registry.AddFixturesToContainer(container); var library = TestRunnerBuilder.BuildLibrary(_lifecycle, observer, container, fixtureAssembly.Filter.CreateTypeFilter(), _system.BuildConverter()); var source = new FixtureContainerSource(container); _runner = new TestRunner(_lifecycle, library, source); if (_listener != null) { _runner.Listener = _listener; } return library; } catch (TestEngineFailureException) { throw; } catch (Exception e) { throw new TestEngineFailureException(e.ToString()); } }
public void SetUp() { container = new Container(); var registry = new FixtureRegistry(); registry.AddFixturesFromThisAssembly(); registry.AddFixturesToContainer(container); observer = MockRepository.GenerateMock<IFixtureObserver>(); var filter = new CompositeFilter<Type>(); filter.Includes += t => t.Name.StartsWith("M"); builder = new LibraryBuilder(observer, filter, new ObjectConverter()); library = builder.Build(new TestContext(container)); }
public virtual void RegisterFixtures(FixtureRegistry registry) { Assembly assembly = GetType().Assembly; registry.AddFixturesFromAssembly(assembly); }
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); }
public void RegisterFixtures(FixtureRegistry registry) { throw new NotImplementedException(); }
public void RegisterFixtures(FixtureRegistry registry) { _configure(registry); }
protected override void fixturesAre(FixtureRegistry registry) { registry.AddFixture <SentenceGrammarFixture>(); }
protected override void fixturesAre(FixtureRegistry registry) { registry.AddFixture <ParagraphGrammarFixture>(); }
public void RegisterFixtures(FixtureRegistry registry) { }
public override void RegisterFixtures(FixtureRegistry registry) { registry.AddFixturesFromThisAssembly(); }
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)); }
public void SetUp() { registry = new FixtureRegistry(); _context = null; }
public void SetUp() { registry = new FixtureRegistry(); _context = null; }
public void RegisterFixtures(FixtureRegistry registry) { registry.AddFixturesFromThisAssembly(); }
public override void RegisterFixtures(FixtureRegistry registry) { registry.AddFixture <NameScreenFixture>(); }