Skip to content

Commit 6dd892b

Browse files
committed
Add config check to CommentsCognitiveTests for Cognitive API
Added validation to ensure CognitiveEndpoint and CognitiveKey are set in AppConfig before running CommentsCognitiveTests. The test is now marked inconclusive if required configuration is missing, preventing false failures.
1 parent 8da00d8 commit 6dd892b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AnalyticsEngine/Tests.UnitTests/AppInsightsImportTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ public async Task CommentsCognitiveTests()
326326
{
327327
var config = new AppConfig();
328328

329+
if (string.IsNullOrEmpty(config.CognitiveEndpoint) || string.IsNullOrEmpty(config.CognitiveKey))
330+
{
331+
Assert.Inconclusive("CognitiveEndpoint or CognitiveKey is not configured.");
332+
}
329333
var credentials = new AzureKeyCredential(config.CognitiveKey);
330334
var client = new TextAnalyticsClient(new Uri(config.CognitiveEndpoint), credentials);
331335

0 commit comments

Comments
 (0)