public void TearDown() { if ((context != null) && (((IObjectContextAdapter)context).ObjectContext.Connection.State == System.Data.ConnectionState.Open)) { ((IObjectContextAdapter)context).ObjectContext.Connection.Close(); context = null; } }
public void SetUp() { Database.SetInitializer(new DataSeedingInitializer()); context = new MyDbContext("DefaultDb"); customerRepository = new Infrastructure.Tests.Data.Lab.CustomerRepository(context); repository = new Infrastructure.Data.EntityFramework.Lab.GenericRepository(context); }