public void SetUp() { Configurator = new AntlerConfigurator(); Configurator.UseStructureMapContainer().UseStorage(NHibernateStorage.Use.WithDatabaseConfiguration(SQLiteConfiguration.Standard.InMemory()).WithMappings(From.AssemblyWithType <CountryMap>().First())); session = NewSessionForTesting.CreateNHibernateSession(Configurator, typeof(NHibernateStorage), UnitOfWorkSettings.Default.StorageName); }
public void should_set_container() { //arrange var configurator = new AntlerConfigurator(); //act configurator.UseStructureMapContainer(); //assert configurator.Configuration.Container.Should().BeOfType <StructureMapContainerAdapter>(); }
public void should_set_storage() { //arrange var configurator = new AntlerConfigurator(); //act configurator.UseStructureMapContainer().UseStorage(NHibernateStorage.Use.WithDatabaseConfiguration(SQLiteConfiguration.Standard.InMemory())); //assert configurator.Configuration.Container.Get <ISessionScopeFactory>().Should().BeOfType <NHibernateSessionScopeFactory>(); }
public void should_set_container_with_registered_components() { //arrange var container = new Container(x => x.For <TestComponent>().Use <TestComponent>()); var configurator = new AntlerConfigurator(); //act configurator.UseStructureMapContainer(container); //assert configurator.Configuration.Container.Should().BeOfType <StructureMapContainerAdapter>(); configurator.Configuration.Container.Get <TestComponent>().Should().BeOfType <TestComponent>(); }