public CredentialService(CredentialsFactory factory) { if (factory == null) { throw new ArgumentNullException("factory"); } _factory = factory; }
internal void DoShutdown() { Clients.TryRemove(_instanceName, out _); DisposeAll(_onClientShutdownDisposables); // Statistics.Destroy(); ExecutionService.Shutdown(); ConnectionManager.Shutdown(); ProxyManager.Destroy(); InvocationService.Shutdown(); NearCacheManager.Shutdown(); ListenerService.Dispose(); SerializationService.Destroy(); CredentialsFactory.Dispose(); }
public async Task CreatedCredentialsHaveSubscriptionKeyInRequestHeader() { var subscriptionKey = "SubscriptionKey"; var factory = new CredentialsFactory(); var apiKeyService = factory.CreateApiKeyServiceCredentials(subscriptionKey); var httpRequest = new HttpRequestMessage(); await apiKeyService.ProcessHttpRequestAsync(httpRequest, new CancellationToken()).ConfigureAwait(false); var enumerator = httpRequest.Headers.GetEnumerator(); enumerator.MoveNext(); Assert.Equal(subscriptionKey, enumerator.Current.Value.First()); httpRequest.Dispose(); }