Exemplo n.º 1
0
        public BaseTest()
        {
            _testApiKey        = Environment.GetEnvironmentVariable("ALGOLIA_API_KEY");
            _testApplicationID = Environment.GetEnvironmentVariable("ALGOLIA_APPLICATION_ID");
            _client            = new AlgoliaClient(_testApplicationID, _testApiKey);
            _index             = _client.InitIndex(GetSafeName("àlgol?à-csharp"));
            _analytics         = new Analytics(_client);
            _indexHelper       = new IndexHelper <TestModel>(_client, GetSafeName("àlgol?à-csharp"));

            _testApiKeyMCM        = Environment.GetEnvironmentVariable("ALGOLIA_API_KEY_MCM");
            _testApplicationIDMCM = Environment.GetEnvironmentVariable("ALGOLIA_APPLICATION_ID_MCM");
            _clientMCM            = new AlgoliaClient(_testApplicationIDMCM, _testApiKeyMCM);
            _userID = GetUniqueUserID("csharp-client");
        }
 /// <summary>
 /// Check to see if the asynchronous server task is complete.
 /// </summary>
 /// <param name="indexName">The index associated with the task.</param>
 /// <param name="taskID">The id of the task returned by server.</param>
 /// <param name="requestOptions"></param>
 /// <param name="timeToWait"></param>
 /// <param name="token"></param>
 async public Task WaitTaskAsync(string indexName, string taskID, RequestOptions requestOptions = null, int timeToWait = 100, CancellationToken token = default(CancellationToken))
 {
     await _client.InitIndex(indexName).WaitTaskAsync(taskID, requestOptions, timeToWait, token);
 }