public void InitializeTest()
 {
     storage = new MixedCurriculumStorage(lmsService);
     using (context = lmsService.GetDbDataContext())
     {
         ClearDb();
     }
 }
Beispiel #2
0
        protected virtual IDataContext GetDbContext()
        {
            var db = new DBDataContext();

#if DEBUG
            db.Log = this.Logger;
#endif

            return db;
        }
 private void ClearDb()
 {
     context = lmsService.GetDbDataContext();
     context.CurriculumAssignments.DeleteAllOnSubmit(context.CurriculumAssignments);
     context.Themes.DeleteAllOnSubmit(context.Themes);
     context.Stages.DeleteAllOnSubmit(context.Stages);
     context.Curriculums.DeleteAllOnSubmit(context.Curriculums);
     context.CurriculumAssignments.DeleteAllOnSubmit(context.CurriculumAssignments);
     context.SubmitChanges();
 }
        protected virtual IDataContext GetDbContext()
        {
            var context = new DBDataContext();
            // context.DeferredLoadingEnabled = false;
#if DEBUG
            context.Log = this.logger;
#endif

            return context; // new DBDataContext();
        }
 public CurriculumStorageTest()
 {
     lmsService = null;// new FakeLmsService();
     using (context = lmsService.GetDbDataContext())
     {
         if (context.DatabaseExists())
         {
             context.DeleteDatabase();
         }
         context.CreateDatabase();
         InitializeDb();
     }
 }
Beispiel #6
0
        public DatabaseBanStorage(ILmsService lmsService, LinqLogger logger)
        {
            this.LmsService = lmsService;
            this.Logger = logger;
            this.CreateIDataContext = () =>
                {
                    var db = new DBDataContext();

#if DEBUG
                    db.Log = logger;
#endif

                    return db;
                };
        }
 public void RefreshState()
 {
     _Db = _LmsService.GetDbDataContext();
 }
 private Theme GetTheme(int id, DBDataContext db)
 {
     return db.Themes.SingleOrDefault(item => item.Id == id && !item.IsDeleted);
 }
 public void RefreshState()
 {
     //db = new DBDataContext(lmsService.GetDbConnectionString());
     _Db = _LmsService.GetDbDataContext();
 }
Beispiel #10
0
 public MixedCourseStorage(ILmsService lmsService)
 {
     db = lmsService.GetDBDataContext();
 }
 public void RefreshState()
 {
     _Db = new DBDataContext();
 }