示例#1
0
            public void SetUp()
            {
                Configurator = new AntlerConfigurator();

                var connectionString = ConfigurationManager.AppSettings["ConnectionString"];

                Configurator.UseWindsorContainer()
                .UseStorage(EntityFrameworkStorage.Use.WithConnectionString(connectionString)
                            .WithMappings(From.AssemblyWithType <CountryMap>().First())
                            .WithRecreatedDatabase(true), "JustToGenerateStuff")
                .UseStorage(Linq2DbStorage.Use(connectionString));
            }
示例#2
0
            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");
            }
示例#3
0
            public void SetUp()
            {
                Configurator = new AntlerConfigurator();

                var connectionString     = ConfigurationManager.AppSettings["ConnectionString"];
                var assemblyWithMappings = From.AssemblyWithType <CountryMap>().First();

                Configurator.UseStructureMapContainer()
                .UseStorage(typeof(T) == typeof(LazyLoading)
                                            ? EntityFrameworkStorage.Use.WithConnectionString(connectionString)
                            .WithMappings(assemblyWithMappings).WithRecreatedDatabase(true)
                                            : EntityFrameworkStorage.Use.WithoutLazyLoading()
                            .WithConnectionString(connectionString)
                            .WithMappings(assemblyWithMappings).WithRecreatedDatabase(true));
            }
示例#4
0
            public void SetUp()
            {
                Configurator = new AntlerConfigurator();

                const string connectionString     = "Data Source=TestDB.sdf";
                var          assemblyWithMappings = From.AssemblyWithType <CountryMap>().First();

                Configurator.UseWindsorContainer()
                .UseStorage(typeof(T) == typeof(LazyLoading)
                                            ? EntityFrameworkPlusSqlCe.Use.WithConnectionString(connectionString)
                            .WithMappings(assemblyWithMappings).WithRecreatedDatabase(true)
                                            : EntityFrameworkPlusSqlCe.Use.WithoutLazyLoading()
                            .WithConnectionString(connectionString)
                            .WithMappings(assemblyWithMappings).WithRecreatedDatabase(true));
            }
示例#5
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);
            }
示例#6
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);
            }
示例#7
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()));
            }