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

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

            return db;
        }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
        protected virtual IDataContext GetDbContext()
        {
            var context = new DBDataContext();
            // context.DeferredLoadingEnabled = false;
#if DEBUG
            context.Log = this.logger;
#endif

            return context; // new DBDataContext();
        }
Exemplo n.º 5
0
 public CurriculumStorageTest()
 {
     lmsService = null;// new FakeLmsService();
     using (context = lmsService.GetDbDataContext())
     {
         if (context.DatabaseExists())
         {
             context.DeleteDatabase();
         }
         context.CreateDatabase();
         InitializeDb();
     }
 }
Exemplo n.º 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;
                };
        }
Exemplo n.º 7
0
 public void RefreshState()
 {
     _Db = _LmsService.GetDbDataContext();
 }
Exemplo n.º 8
0
 private Theme GetTheme(int id, DBDataContext db)
 {
     return db.Themes.SingleOrDefault(item => item.Id == id && !item.IsDeleted);
 }
Exemplo n.º 9
0
 public void RefreshState()
 {
     //db = new DBDataContext(lmsService.GetDbConnectionString());
     _Db = _LmsService.GetDbDataContext();
 }
Exemplo n.º 10
0
 public MixedCourseStorage(ILmsService lmsService)
 {
     db = lmsService.GetDBDataContext();
 }
Exemplo n.º 11
0
 public void RefreshState()
 {
     _Db = new DBDataContext();
 }