public Build ( TestContext context ) : |
||
context | TestContext | |
return |
public static FixtureLibrary BuildLibrary(SystemLifecycle lifeCycle, IFixtureObserver observer, IContainer container, CompositeFilter <Type> filter) { try { var builder = new LibraryBuilder(observer, filter); observer.RecordStatus("Starting to rebuild the fixture model"); var context = new TestContext(container); observer.RecordStatus("Setting up the system environment"); lifeCycle.StartApplication(); lifeCycle.SetupEnvironment(); observer.RecordStatus("Registering the system services"); lifeCycle.RegisterServices(context); builder.Finder = context.Finder; observer.RecordStatus("Starting to read fixtures"); return(builder.Build(context)); } finally { observer.RecordStatus("Finished rebuilding the fixture model"); } }
public void SetUp() { var context = new TestContext(x => { x.AddFixture<FixtureWithHiddenGrammarsFixture>(); }); var observer = MockRepository.GenerateMock<IFixtureObserver>(); var builder = new LibraryBuilder(observer, new CompositeFilter<Type>()); builder.Build(context); library = builder.Library; }
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 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() { observer = MockRepository.GenerateMock<IFixtureObserver>(); var filter = new CompositeFilter<Type>(); filter.Includes += t => t.Name.StartsWith("M"); builder = new LibraryBuilder(observer, filter); library = builder.Build(new TestContext(x => x.AddFixturesFromThisAssembly())); }
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)); }
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); }