public static void TestSetup(TestContext context)
 {
     SFApplicationHelper.RegisterServices();
     SDKServiceLocator.RegisterService <ILoggingService, Hybrid.Logging.Logger>();
     Store = SmartStore.GetGlobalSmartStore();
     Store.ResetDatabase();
     Store.RegisterSoup(TEST_SOUP, new[] { new IndexSpec("key", SmartStoreType.SmartString) });
 }
 public static void TestSetup(TestContext context)
 {
     SFApplicationHelper.RegisterServices();
     SDKServiceLocator.RegisterService<ILoggingService, Hybrid.Logging.Logger>();
     Store = SmartStore.GetGlobalSmartStore();
     Store.ResetDatabase();
     Store.RegisterSoup(TEST_SOUP, new[] {new IndexSpec("key", SmartStoreType.SmartString)});
 }
 private static void CreateAccountsSoup()
 {
     IndexSpec[] indexSpecs =
     {
         new IndexSpec(Constants.Id,      SmartStoreType.SmartString),
         new IndexSpec(Constants.Name,    SmartStoreType.SmartString),
         new IndexSpec(SyncManager.Local, SmartStoreType.SmartString)
     };
     _smartStore.RegisterSoup(AccountsSoup, indexSpecs);
 }
        private static void SetupData()
        {
            Store.ResetDatabase();

            Store.RegisterSoup(EMPLOYEES_SOUP, new[]
            {
                // should be TABLE_1
                new IndexSpec(FIRST_NAME, SmartStoreType.SmartString),  // should be TABLE_1_0
                new IndexSpec(LAST_NAME, SmartStoreType.SmartString),   // should be TABLE_1_1
                new IndexSpec(DEPT_CODE, SmartStoreType.SmartString),   // should be TABLE_1_2
                new IndexSpec(EMPLOYEE_ID, SmartStoreType.SmartString), // should be TABLE_1_3
                new IndexSpec(MANAGER_ID, SmartStoreType.SmartString),  // should be TABLE_1_4
                new IndexSpec(SALARY, SmartStoreType.SmartInteger)
            });                                                         // should be TABLE_1_5
            Store.RegisterSoup(DEPARTMENTS_SOUP, new[]
            {
                // should be TABLE_2
                new IndexSpec(DEPT_CODE, SmartStoreType.SmartString), // should be TABLE_2_0
                new IndexSpec(NAME, SmartStoreType.SmartString),      // should be TABLE_2_1
                new IndexSpec(BUDGET, SmartStoreType.SmartInteger)
            });                                                       // should be TABLE_2_2
            LoadData();
        }
 /// <summary>
 ///     Create syncs soup if needed.
 /// </summary>
 /// <param name="store"></param>
 public static void SetupSyncsSoupIfNeeded(SmartStore.Store.SmartStore store)
 {
     if (store.HasSoup(Constants.SyncsSoup))
     {
         return;
     }
     IndexSpec[] indexSpecs = {new IndexSpec(Constants.SyncType, SmartStoreType.SmartString)};
     store.RegisterSoup(Constants.SyncsSoup, indexSpecs);
 }
示例#6
0
 public static void TestSetup(TestContext context)
 {
     Store = SmartStore.GetGlobalSmartStore();
     Store.ResetDatabase();
     Store.RegisterSoup(TEST_SOUP, new[] { new IndexSpec("key", SmartStoreType.SmartString) });
 }
 public static void TestSetup(TestContext context)
 {
     Store = SmartStore.GetGlobalSmartStore();
     Store.ResetDatabase();
     Store.RegisterSoup(TEST_SOUP, new[] {new IndexSpec("key", SmartStoreType.SmartString)});
 }