public void CreateDatabase() { var builder = new CoursesContextBuilder(ConfigurationManager.ConnectionStrings["CoursesConnection"].ConnectionString); var context = builder.GetContext(); if (context.DatabaseExists()) { context.DeleteDatabase(); } context.CreateDatabase(); Assert.IsTrue(context.DatabaseExists()); }
public void CleanupContextManagerAndDatabase() { _contextManager.CleanupCurrent(); var contextBuilder = new CoursesContextBuilder(ConfigurationManager.ConnectionStrings["CoursesConnection"].ConnectionString); using (var context = contextBuilder.GetContext()) { if (context.DatabaseExists()) { context.DeleteDatabase(); } } }
public void SetupDatabaseAndContextBuilder() { _contextBuilder = new CoursesContextBuilder(ConfigurationManager.ConnectionStrings["CoursesConnection"].ConnectionString); using (var context = _contextBuilder.GetContext()) { if (context.DatabaseExists()) { context.DeleteDatabase(); } context.CreateDatabase(); } }
public CoursesContextManager(string connectionString) { this._contextBuilder = new CoursesContextBuilder(connectionString); }
public void CreateContext() { var builder = new CoursesContextBuilder(ConfigurationManager.ConnectionStrings["CoursesConnection"].ConnectionString); var context = builder.GetContext(); Assert.IsNotNull(context); }