public static async Task TestSetup(TestContext context) { SFApplicationHelper.RegisterServices(); SDKServiceLocator.RegisterService <ILoggingService, Hybrid.Logging.Logger>(); var settings = new EncryptionSettings(new HmacSHA256KeyGenerator(HashAlgorithmNames.Sha256)); Encryptor.init(settings); var options = new LoginOptions(TestCredentials.LoginUrl, TestCredentials.ClientId, TestCallbackUrl, "mobile", TestScopes); var response = new AuthResponse { RefreshToken = TestCredentials.RefreshToken, AccessToken = TestAuthToken, InstanceUrl = TestCredentials.InstanceUrl, IdentityUrl = TestCredentials.IdentityUrl, Scopes = TestScopes, }; Account account = await AccountManager.CreateNewAccount(options, response); account.UserId = TestCredentials.UserId; account.UserName = TestCredentials.Username; await OAuth2.RefreshAuthTokenAsync(account); _smartStore = SmartStore.GetSmartStore(); _smartStore.ResetDatabase(); _syncManager = SyncManager.GetInstance(); _restClient = new RestClient(account.InstanceUrl, account.AccessToken, async(cancellationToken) => { account = AccountManager.GetAccount(); account = await OAuth2.RefreshAuthTokenAsync(account); return(account.AccessToken); } ); CreateAccountsSoup(); _idToNames = await CreateTestAccountsOnServer(CountTestAccounts); }