Beispiel #1
0
        public async Task TextAnalyticsConfigSetTestAsync(string azureResourceKey, string azureResourceEndpoint, string defaultLanguage, bool?enableSentimentByDefault, bool?enableNerByDefault, bool?enableKeyphraseByDefault)
        {
            await _controller.SetTextAnalyticsConfigsAsync(azureResourceKey, azureResourceEndpoint, defaultLanguage, enableSentimentByDefault, enableNerByDefault, enableKeyphraseByDefault);

            await _controller.SetTextAnalyticsConfigsAsync(null, null, null, null, null, null); // Value not affected if user doesn't pass it

            // assert
            var configsFile = await _storageService.ReadFileAsStringAsync(Constants.ConfigsFileName);

            var configModel = JsonConvert.DeserializeObject <ConfigModel>(configsFile);

            Assert.Equal(azureResourceKey, configModel.TextAnalytics.AzureResourceKey);
            Assert.Equal(azureResourceEndpoint, configModel.TextAnalytics.AzureResourceEndpoint);
            Assert.Equal(enableSentimentByDefault, configModel.TextAnalytics.DefaultOperations.Sentiment);
            Assert.Equal(enableNerByDefault, configModel.TextAnalytics.DefaultOperations.Ner);
            Assert.Equal(enableKeyphraseByDefault, configModel.TextAnalytics.DefaultOperations.Keyphrase);
        }