public void Initialize() { var connection = Effort.DbConnectionFactory.CreateTransient(); this.model = CompiledModels.GetModel <RelationEntity, EmptyEntity>(); this.context = new FeatureDbContext(connection, this.model); }
public void Initialize() { this.context = new FeatureDbContext( DbConnectionFactory.CreateTransient(), CompiledModels.GetModel <MathEntity>()); }
public void DbManager_ClearTables() { var connection = (EffortConnection)DbConnectionFactory.CreateTransient(); var model = CompiledModels.GetModel <RelationEntity, EmptyEntity>(); var context = new FeatureDbContext(connection, model); context.Database.Initialize(true); context.RelationEntities.Add( new RelationEntity { RequiredRelation = new EmptyEntity() }); context.SaveChanges(); // Create new context context = new FeatureDbContext(connection, model); // The records should be in context.EmptyEntities.Count().Should().Be(1); context.RelationEntities.Count().Should().Be(1); // Use DbManager to delete all data from the database connection.Open(); connection.DbManager.ClearTables(); // Tables should be empty context.EmptyEntities.Count().Should().Be(0); context.RelationEntities.Count().Should().Be(0); }
public void Initialize() { this.context = new FeatureDbContext( Effort.DbConnectionFactory.CreateTransient(), CompiledModels.GetModel < StringFieldEntity>()); }
public void Initialize() { DbConnection connection = Effort.DbConnectionFactory.CreateTransient(); this.context = new FeatureDbContext( connection, CompiledModels.GetModel <GuidKeyEntity>()); }
public void Initialize() { this.connection = (EffortConnection)DbConnectionFactory.CreateTransient(); this.context = new FeatureDbContext( connection, CompiledModels.GetModel <RequiredFieldEntity>()); this.context.Configuration.ValidateOnSaveEnabled = false; }
public void Initialize() { DbConnection connection = DbConnectionFactory.CreateTransient(); InitializeData(connection); this.context = new FeatureDbContext( connection, CompiledModels.GetModel <NumberFieldEntity>()); }
public void StringFieldFixture_LargeStringFieldCreation() { DbConnection connection = Effort.DbConnectionFactory.CreateTransient(); FeatureDbContext context = new FeatureDbContext( connection, CompiledModels.GetModel <LargeStringFieldEntity>()); context.Database.Initialize(true); }
public void LargePrimaryKeyCreation() { var connection = DbConnectionFactory.CreateTransient(); var context = new FeatureDbContext( connection, CompiledModels.GetModel <LargePrimaryKeyEntity>()); context.Database.CreateIfNotExists(); }
public void SpatialFixture_SpatialFeatureCreation() { DbConnection connection = Effort.DbConnectionFactory.CreateTransient(); FeatureDbContext context = new FeatureDbContext( connection, CompiledModels.GetModel <SpatialEntity>()); context.Database.Initialize(true); }
public void Initialize() { if (connection == null) { connection = Effort.DbConnectionFactory.CreateTransient(); this.context = new FeatureDbContext( connection, CompiledModels.GetModel < StringFieldEntity>()); this.context.Database.CreateIfNotExists(); } }
public void Initialize() { this.context = new FeatureDbContext( Effort.DbConnectionFactory.CreateTransient(), CompiledModels.GetModel <TimeFieldEntity>()); this.Entities.Add( new TimeFieldEntity { Time = stored }); this.context.SaveChanges(); }
private static void InitializeData(DbConnection connection) { var context = new FeatureDbContext( connection, CompiledModels.GetModel <NumberFieldEntity>()); context.NumberFieldEntities.Add( new NumberFieldEntity { Value8 = 0x0f, Value16 = 0x0f, Value32 = 0x0f, Value64 = 0x0f }); context.SaveChanges(); connection.Close(); }