public async Task WhenDataIsNotEncryptedAndIsAStringThenReadStringFromTableStorage()
        {
            // Act
            var result = await service.GetConfigAsync <string>(Constants.IntegrationTestServiceName, Constants.SingleStringKeyName, false).ConfigureAwait(false);

            // Assert
            Assert.Equal(JsonConvert.DeserializeObject <string>(Constants.SingleStringValue), result);
        }
Example #2
0
        public async Task GetSearchIndexClientWhenIndexClientIsNullCallSharedConfigurationService()
        {
            // Act
            var result = await defaultConfigFactory.GetSearchIndexClient().ConfigureAwait(false);

            // Assert
            A.CallTo(() => defaultSharedConfigService.GetConfigAsync <JobProfileSearchIndexConfig>(A <string> .Ignored, A <string> .Ignored, A <bool> .Ignored)).MustHaveHappenedOnceExactly();
            Assert.Equal(defaultSharedConfig.SearchIndex, result.IndexName);
        }
Example #3
0
        public SearchIndexClientFactoryTests()
        {
            defaultSharedConfig = new JobProfileSearchIndexConfig {
                SearchIndex = "SharedIndexName", AccessKey = "SharedAccessKey", SearchServiceName = "JobProfilesApiTest"
            };
            defaultSharedConfigService = A.Fake <ISharedConfigurationService>();
            A.CallTo(() => defaultSharedConfigService.GetConfigAsync <JobProfileSearchIndexConfig>(A <string> .Ignored, A <string> .Ignored, A <bool> .Ignored)).Returns(defaultSharedConfig);

            defaultConfigParams = new SharedConfigParameters {
                SharedConfigServiceName = "TestServiceName", SharedConfigKeyName = "TestKeyName"
            };
            defaultConfigFactory = new SearchIndexClientFactory(defaultSharedConfigService, defaultConfigParams);
        }
Example #4
0
 private async Task <JobProfileSearchIndexConfig> GetIndexConfig() => await sharedConfigurationService
 .GetConfigAsync <JobProfileSearchIndexConfig>(sharedConfigParameters.SharedConfigServiceName, sharedConfigParameters.SharedConfigKeyName)
 .ConfigureAwait(false);