コード例 #1
0
ファイル: DomainSpecs.cs プロジェクト: microtan/Antler
            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 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()));
            }
コード例 #3
0
            public void should_not_have_any_container()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //assert
                configurator.Configuration.Container.Should().BeNull();
            }
コード例 #4
0
            public void SetUp()
            {
                Configurator = new AntlerConfigurator();
                Configurator.UseBuiltInContainer().UseStorage(NHibernateStorage.Use.WithDatabaseConfiguration(SQLiteConfiguration.Standard.InMemory()).WithMappings(From.AssemblyWithType <CountryMap>().First())).
                UseStorage(EntityFrameworkPlusSqlCe.Use.WithConnectionString("Data Source=TestDB.sdf").WithMappings(From.AssemblyWithType <Antler.Specs.Shared.EntityFramework.Mappings.CountryMap>().First()).WithRecreatedDatabase(true), "Second");

                nhSession = NewSessionForTesting.CreateNHibernateSession(Configurator, typeof(NHibernateStorage), UnitOfWorkSettings.Default.StorageName);
            }
コード例 #5
0
            public void should_throw_exception()
            {
                //arrange
                var basicConfigurator = new AntlerConfigurator();

                //act
                basicConfigurator.UseStorage(NHibernateStorage.Use);
            }
コード例 #6
0
            public void should_throw_exception()
            {
                //arrange
                var basicConfigurator = new AntlerConfigurator();

                //act
                basicConfigurator.UseStorage(EntityFrameworkPlusSqlCe.Use);
            }
コード例 #7
0
ファイル: ConfigurationSpecs.cs プロジェクト: microtan/Antler
            public void should_not_fail()
            {
                //act
                var configurator = new AntlerConfigurator();

                configurator.UseBuiltInContainer()
                .UseStorage(MongoDbStorage.Use("mongodb://localhost:27017", "AntlerTest")
                            .WithRecreatedDatabase(true));
            }
コード例 #8
0
            public void should_set_container()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //act
                configurator.UseWindsorContainer();

                //assert
                configurator.Configuration.Container.Should().BeOfType <WindsorContainerAdapter>();
            }
コード例 #9
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>();
            }
コード例 #10
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>();
            }
コード例 #11
0
ファイル: ConfigurationSpecs.cs プロジェクト: microtan/Antler
            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>();
            }
コード例 #12
0
ファイル: ConfigurationSpecs.cs プロジェクト: microtan/Antler
            public void should_throw_exception()
            {
                //arrange
                var configurator = new AntlerConfigurator();

                //act
                configurator.UseBuiltInContainer()
                .UseStorage(
                    NHibernateStorage.Use.WithDatabaseConfiguration(SQLiteConfiguration.Standard.InMemory())
                    .WithMappings(From.AssemblyWithType <CountryMap>().First()), "Super")
                .
                UseStorage(
                    NHibernateStorage.Use.WithDatabaseConfiguration(SQLiteConfiguration.Standard.InMemory())
                    .WithMappings(From.AssemblyWithType <CountryMap>().First()), "Super");
            }
コード例 #13
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>();
            }