Пример #1
0
 public void UpdateTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr  = new GenericUpdater <Surveys, DateTime?>(sourceContext: dbcontext, destinationContext: dbOffcontext);
             var max = gr.GetMax(a => a.ModifiedOn);
             var c   = gr.GetToUpdateData(a => a.ModifiedOn, b => b.ModifiedOn != null && b.ModifiedOn > max, false);
         }
 }
Пример #2
0
 public void GenericMaxTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr = new GenericUpdater <Surveys, DateTime?>(dbcontext, dbOffcontext);
             var b  = gr.GetMax(a => a.ModifiedOn);
             Assert.AreEqual(1, 1);
         }
 }
 private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     if (updater == null)
     {
         GameObject obj = new GameObject("CustomHapticFeedbackUpdater");
         updater = obj.AddComponent <GenericUpdater>();
         GameObject.DontDestroyOnLoad(obj);
         updater.OnUpdate += HMLib::PersistentSingleton <MyHapticFeedbackController> .instance.OnUpdate;
         logger.Debug("Updater ready");
     }
 }
Пример #4
0
 public void InsertTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr  = new GenericUpdater <Surveys, DateTime?>(sourceContext: dbcontext, destinationContext: dbOffcontext);
             var max = gr.GetMax(a => a.CreatedOn);
             var c   = gr.GetToUpdateData(a => a.CreatedOn, b => b.CreatedOn != null && b.CreatedOn > max, true);
             Assert.AreEqual(c, 1);
         }
 }