Пример #1
0
            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);
            }
Пример #2
0
            public void should_set_container()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //act
                configurator.UseStructureMapContainer();

                //assert
                configurator.Configuration.Container.Should().BeOfType <StructureMapContainerAdapter>();
            }
Пример #3
0
            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>();
            }
Пример #4
0
            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>();
            }