Esempio n. 1
0
        public DocumentClientInitializer(IDocumentClientTestProvider testProvider, ILogger <DocumentClientInitializer> logger)
        {
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));

            _testProvider = testProvider;
            _logger       = logger;
        }
        public FhirDocumentClientInitializer(IDocumentClientTestProvider testProvider, IFhirRequestContextAccessor fhirRequestContextAccessor, ILogger <FhirDocumentClientInitializer> logger)
        {
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(fhirRequestContextAccessor, nameof(fhirRequestContextAccessor));
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));

            _testProvider = testProvider;
            _fhirRequestContextAccessor = fhirRequestContextAccessor;
            _logger = logger;
        }
Esempio n. 3
0
 public TestCosmosHealthCheck(
     IScoped <IDocumentClient> documentClient,
     CosmosDataStoreConfiguration configuration,
     IOptionsSnapshot <CosmosCollectionConfiguration> namedCosmosCollectionConfigurationAccessor,
     IDocumentClientTestProvider testProvider,
     ILogger <CosmosHealthCheck> logger)
     : base(
         documentClient,
         configuration,
         namedCosmosCollectionConfigurationAccessor,
         TestCosmosHealthCheckName,
         testProvider,
         logger)
 {
 }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CosmosHealthCheck"/> class.
        /// </summary>
        /// <param name="documentClient">The document client factory/</param>
        /// <param name="configuration">The CosmosDB configuration.</param>
        /// <param name="testProvider">The test provider</param>
        /// <param name="logger">The logger.</param>
        public CosmosHealthCheck(
            IScoped <IDocumentClient> documentClient,
            CosmosDataStoreConfiguration configuration,
            IDocumentClientTestProvider testProvider,
            ILogger <CosmosHealthCheck> logger)
        {
            EnsureArg.IsNotNull(documentClient, nameof(documentClient));
            EnsureArg.IsNotNull(configuration, nameof(configuration));
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _documentClient = documentClient;

            EnsureArg.IsNotNull(_documentClient, optsFn: options => options.WithMessage("Factory returned null."));

            _configuration = configuration;
            _testProvider  = testProvider;
            _logger        = logger;
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CosmosHealthCheck"/> class.
        /// </summary>
        /// <param name="documentClient">The document client factory/</param>
        /// <param name="configuration">The CosmosDB configuration.</param>
        /// <param name="namedCosmosCollectionConfigurationAccessor">The IOptions accessor to get a named version.</param>
        /// <param name="collectionConfigurationName"> Name to get corresponding collection configuration</param>
        /// <param name="testProvider">The test provider</param>
        /// <param name="logger">The logger.</param>
        public CosmosHealthCheck(
            IScoped <IDocumentClient> documentClient,
            CosmosDataStoreConfiguration configuration,
            IOptionsSnapshot <CosmosCollectionConfiguration> namedCosmosCollectionConfigurationAccessor,
            string collectionConfigurationName,
            IDocumentClientTestProvider testProvider,
            ILogger <CosmosHealthCheck> logger)
        {
            EnsureArg.IsNotNull(documentClient, nameof(documentClient));
            EnsureArg.IsNotNull(configuration, nameof(configuration));
            EnsureArg.IsNotNull(namedCosmosCollectionConfigurationAccessor, nameof(namedCosmosCollectionConfigurationAccessor));
            EnsureArg.IsNotNullOrWhiteSpace(collectionConfigurationName, nameof(collectionConfigurationName));
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _documentClient = documentClient;
            _configuration  = configuration;
            _cosmosCollectionConfiguration = namedCosmosCollectionConfigurationAccessor.Get(collectionConfigurationName);
            _testProvider = testProvider;
            _logger       = logger;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FhirCosmosHealthCheck"/> class.
        /// </summary>
        /// <param name="documentClient">The document client factory/</param>
        /// <param name="configuration">The CosmosDB configuration.</param>
        /// <param name="namedCosmosCollectionConfigurationAccessor">The IOptions accessor to get a named version.</param>
        /// <param name="testProvider">The test provider</param>
        /// <param name="logger">The logger.</param>
        public FhirCosmosHealthCheck(
            IScoped <IDocumentClient> documentClient,
            CosmosDataStoreConfiguration configuration,
            IOptionsSnapshot <CosmosCollectionConfiguration> namedCosmosCollectionConfigurationAccessor,
            IDocumentClientTestProvider testProvider,
            ILogger <FhirCosmosHealthCheck> logger)
        {
            EnsureArg.IsNotNull(documentClient, nameof(documentClient));
            EnsureArg.IsNotNull(configuration, nameof(configuration));
            EnsureArg.IsNotNull(namedCosmosCollectionConfigurationAccessor, nameof(namedCosmosCollectionConfigurationAccessor));
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _documentClient = documentClient;

            EnsureArg.IsNotNull(_documentClient, optsFn: options => options.WithMessage("Factory returned null."));

            _configuration           = configuration;
            _collectionConfiguration = namedCosmosCollectionConfigurationAccessor.Get(Constants.CollectionConfigurationName);
            _testProvider            = testProvider;
            _logger = logger;
        }