Пример #1
0
            public void SetUp()
            {
                var connectionString = ConfigurationManager.AppSettings["ConnectionString"];

                Configurator = new AntlerConfigurator();
                Configurator.UseWindsorContainer().UseStorage(NHibernateStorage.Use.WithDatabaseConfiguration(MsSqlConfiguration.MsSql2008.ConnectionString(connectionString)).WithCommandToTryToApplyOnServer(DbProviderFactories.GetFactory("System.Data.SqlClient"), connectionString, "CREATE DATABASE AntlerTest").WithRegeneratedSchema(true).WithMappings(From.AssemblyWithType <CountryMap>().First()));
            }
Пример #2
0
            public void should_set_container()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //act
                configurator.UseWindsorContainer();

                //assert
                configurator.Configuration.Container.Should().BeOfType <WindsorContainerAdapter>();
            }
Пример #3
0
            public void should_set_storage()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //act
                configurator.UseWindsorContainer().UseStorage(EntityFrameworkPlusSqlCe.Use);

                //assert
                configurator.Configuration.Container.Get <ISessionScopeFactory>().Should().BeOfType <EntityFrameworkSessionScopeFactory>();
            }
Пример #4
0
            public void should_set_container_with_registered_components()
            {
                //arrange
                var container = new WindsorContainer();

                container.Register(Component.For <TestComponent>());

                var configurator = new AntlerConfigurator();

                //act
                configurator.UseWindsorContainer(container);

                //assert
                configurator.Configuration.Container.Should().BeOfType <WindsorContainerAdapter>();
                configurator.Configuration.Container.Get <TestComponent>().Should().BeOfType <TestComponent>();
            }