public void FixtureSetUp()
        {
            BootStrapper.Bootstrap();

            SessionSource = ObjectFactory.GetInstance<ISessionSource>();
            SessionSource.BuildSchema();
        }
 private void create_schema_if_it_does_not_already_exist(ISessionSource source)
 {
     if (IsNewDatabase)
     {
         source.BuildSchema();
     }
 }
Exemplo n.º 3
0
        public DatabaseFixture()
        {
            var configuration = Fluently.Configure()
                .Database(SQLiteConfiguration.Standard.InMemory())
                .Mappings(m => m.FluentMappings.Conventions.AddFromAssemblyOf<TableNameConvention>());

            SessionSource = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(configuration.BuildConfiguration().Properties, new TestModel());
            SessionSource.BuildSchema();
        }
        public void GivetAttMinFilmsamlingÄrTom()
        {
            // Initera Ioc
            IoCBootstrapper.Init();

            // Sätta upp tom databas med korrekt schema
            _sessionSource = ObjectFactory.GetInstance<ISessionSource>();
            _sessionSource.BuildSchema();
        }
Exemplo n.º 5
0
        public DatabaseFixture()
        {
            var configuration = Fluently.Configure()
                                .Database(SQLiteConfiguration.Standard.InMemory())
                                .Mappings(m => m.FluentMappings.Conventions.AddFromAssemblyOf <TableNameConvention>());

            SessionSource = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(configuration.BuildConfiguration().Properties, new TestModel());
            SessionSource.BuildSchema();
        }
Exemplo n.º 6
0
        public void SetUp()
        {
            var properties = new SQLiteConfiguration()
                             .UseOuterJoin()
                             .InMemory()
                             .ToProperties();

            source = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(properties, new TestPersistenceModel());
            source.BuildSchema();
        }
Exemplo n.º 7
0
        public void SetupContext()
        {
            var cfg = SQLiteConfiguration.Standard
                  .UsingFile(Path.GetTempFileName())
                  .ProxyFactoryFactory(typeof(ProxyFactoryFactory).AssemblyQualifiedName);

            var fc = Fluently.Configure()
                .Database(cfg)
                .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Subscription>());


            sessionSource = new SessionSource(fc);

            sessionSource.BuildSchema();
            storage = new SubscriptionStorage(sessionSource);
        }
Exemplo n.º 8
0
        public void SetUp()
        {
            var configuration = new Configuration()
                                .DataBaseIntegration(db =>
            {
                db.Driver <SQLite20Driver>();
                db.Dialect <SQLiteDialect>();
                db.ConnectionReleaseMode = ConnectionReleaseMode.OnClose;
                db.ConnectionString      = "Data Source=:memory:;Version=3;New=True;";
            });

            var mapping = CreateTestPersistenceModel();

            source = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(configuration, mapping);
            source.BuildSchema();
        }
        public FilmsamlingsSteg()
        {
            // Initera Ioc
            IoCBootstrapper.Init();

            // Sätta upp tom databas med korrekt schema
            _sessionSource = ObjectFactory.GetInstance<ISessionSource>();
            _sessionSource.BuildSchema();

            // Skapad stubbade vyer
            _mockSystemOut = new Mock<TextWriter>();
            var antalFilmerVy = new AntalFilmerVy(_mockSystemOut.Object);
            var listaFilmerVy = new ListaFilmerVy(_mockSystemOut.Object);

            // Hämta vyrepository, som är en singleton, från IoC och lägg till stubb-vyerna
            var vyRepository = ObjectFactory.GetInstance<VyRepository>();
            vyRepository.LäggTill(VyNamn.ANTAL_FILMER, antalFilmerVy);
            vyRepository.LäggTill(VyNamn.LISTA_FILMER, listaFilmerVy);
        }
Exemplo n.º 10
0
        public void SetUp()
        {
            var properties = new SQLiteConfiguration()
                             .UseOuterJoin()
                             //.ShowSql()
                             .InMemory()
                             .ToProperties();

            //var properties = MsSqlConfiguration
            //    .MsSql2005
            //    .ConnectionString
            //    .Server(".")
            //    .Database("FluentNHibernate")
            //    .TrustedConnection
            //    .CreateProperties
            //    .ToProperties();

            _source = new SingleConnectionSessionSourceForSQLiteInMemoryTesting(properties, new TestPersistenceModel());
            _source.BuildSchema();
        }
Exemplo n.º 11
0
 public override void establish_context()
 {
     _sessionSource = build_session_source();
     _sessionSource.BuildSchema();
 }
Exemplo n.º 12
0
 public void should_be_able_to_generate_the_schema()
 {
     _sessionSource.BuildSchema();
 }
 public override void establish_context()
 {
     _sessionSource = build_session_source();
     _sessionSource.BuildSchema();
 }
 private void create_schema_if_it_does_not_already_exist(ISessionSource source)
 {
     if (IsNewDatabase) source.BuildSchema();
 }
Exemplo n.º 15
0
 public void Execute()
 {
     _sessionSource.BuildSchema();
 }