public ClassEnvironment(string alternativeSourceFilePath = null, [CallerFilePath] string sourceFilePath = "") { ThisClassesLog = new ClassLog(alternativeSourceFilePath ?? sourceFilePath); MasterEnvironment.AddClassLog(ThisClassesLog); //ensure the database is set up using (var db = new EfTestDbContext()) { if (!db.EfParents.Any()) { db.ResetDatabaseContent(); //make sure database is loaded after change to model } } }
public void Test01FillDatabaseOk() { using (var db = new EfTestDbContext()) { //SETUP //ATTEMPT db.ResetDatabaseContent(); //VERIFY db.EfParents.Count().ShouldEqual(DatabaseHelpers.BaseData.Count); db.EfChildren.Count().ShouldEqual(DatabaseHelpers.BaseData.SelectMany(x => x.Children).Count()); db.EfPersons.Count().ShouldEqual(DatabaseHelpers.PersonsData.Count); } }