Skip to content

Commit 6e0fdbd

Browse files
committed
test: Updated integration tests
1 parent 72f70c5 commit 6e0fdbd

6 files changed

+52
-3
lines changed

Tests/AssistantV1IntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void TestSetup()
8585
[UnityTest, Order(0)]
8686
public IEnumerator TestMessage()
8787
{
88-
workspaceId = Environment.GetEnvironmentVariable("CONVERSATION_WORKSPACE_ID");
88+
workspaceId = Environment.GetEnvironmentVariable("ASSISTANT_WORKSPACE_ID");
8989
JToken context = null;
9090
MessageResponse messageResponse = null;
9191
JToken conversationId = null;

Tests/AssistantV2IntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public IEnumerator TestMessage()
4747
while (!service.Credentials.HasIamTokenData())
4848
yield return null;
4949

50-
assistantId = Environment.GetEnvironmentVariable("CONVERSATION_ASSISTANT_ID");
50+
assistantId = Environment.GetEnvironmentVariable("ASSISTANT_ASSISTANT_ID");
5151
string sessionId = null;
5252

5353
SessionResponse createSessionResponse = null;

Tests/CompareComplyV1IntegrationTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public IEnumerator TestClassifyElements()
121121
Log.Debug("CompareComplyServiceV1IntegrationTests", "ClassifyElements result: {0}", response.Response);
122122
classifyElementsResponse = response.Result;
123123
Assert.IsNotNull(classifyElementsResponse);
124+
//Assert.IsNotNull(classifyElementsResponse.ContractType);
124125
Assert.IsNotNull(classifyElementsResponse.Elements);
125126
Assert.IsNull(error);
126127
},
@@ -154,6 +155,20 @@ public IEnumerator TestExtractTables()
154155
extractTablesResponse = response.Result;
155156
Assert.IsNotNull(extractTablesResponse);
156157
Assert.IsNotNull(extractTablesResponse.Tables);
158+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderIds);
159+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderTexts);
160+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderTextsNormalized);
161+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderIds);
162+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderTexts);
163+
Assert.IsNotNull(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderTextsNormalized);
164+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderIds.Count > 0);
165+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderTexts.Count > 0);
166+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].RowHeaderTextsNormalized.Count > 0);
167+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderIds.Count > 0);
168+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderTexts.Count > 0);
169+
//Assert.IsTrue(extractTablesResponse.Tables[0].BodyCells[0].ColumnHeaderTextsNormalized.Count > 0);
170+
Assert.IsNotNull(extractTablesResponse.Tables[0].KeyValuePairs);
171+
//Assert.IsTrue(extractTablesResponse.Tables[0].KeyValuePairs.Count > 0);
157172
Assert.IsNull(error);
158173
},
159174
file: ms,

Tests/DiscoveryV1IntegrationTests.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,22 @@ public IEnumerator TestUpdateEnvironment()
206206
public IEnumerator TestCreateConfiguration()
207207
{
208208
Log.Debug("DiscoveryServiceV1IntegrationTests", "Attempting to CreateConfiguration...");
209+
Source source = new Source()
210+
{
211+
Options = new SourceOptions()
212+
{
213+
CrawlAllBuckets = true,
214+
Buckets = new List<SourceOptionsBuckets>()
215+
{
216+
new SourceOptionsBuckets()
217+
{
218+
Limit = 10,
219+
Name = "bucket"
220+
}
221+
}
222+
}
223+
};
224+
209225
Configuration createConfigurationResponse = null;
210226
service.CreateConfiguration(
211227
callback: (DetailedResponse<Configuration> response, IBMError error) =>
@@ -217,11 +233,17 @@ public IEnumerator TestCreateConfiguration()
217233
Assert.IsNotNull(createConfigurationResponse.ConfigurationId);
218234
Assert.IsTrue(createConfigurationResponse.Name == createdConfigurationName);
219235
Assert.IsTrue(createConfigurationResponse.Description == createdConfigurationDescription);
236+
Assert.IsTrue(createConfigurationResponse.Source.Options.CrawlAllBuckets);
237+
Assert.IsNotNull(createConfigurationResponse.Source.Options.Buckets);
238+
Assert.IsTrue(createConfigurationResponse.Source.Options.Buckets.Count > 0);
239+
Assert.IsTrue(createConfigurationResponse.Source.Options.Buckets[0].Name == "bucket");
240+
Assert.IsTrue(createConfigurationResponse.Source.Options.Buckets[0].Limit == 10);
220241
Assert.IsNull(error);
221242
},
222243
environmentId: environmentId,
223244
name: createdConfigurationName,
224-
description: createdConfigurationDescription
245+
description: createdConfigurationDescription,
246+
source: source
225247
);
226248

227249
while (createConfigurationResponse == null)

Tests/NaturalLanguageUnderstandingV1IntegrationTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ public IEnumerator TestAnalyze()
7373
Categories = new CategoriesOptions()
7474
{
7575
Limit = 10
76+
},
77+
Syntax = new SyntaxOptions()
78+
{
79+
Sentences = true,
80+
Tokens = new SyntaxOptionsTokens()
81+
{
82+
PartOfSpeech = true,
83+
Lemma = true
84+
}
7685
}
7786
};
7887

@@ -82,6 +91,7 @@ public IEnumerator TestAnalyze()
8291
Log.Debug("NaturalLanguageUnderstandingServiceV1IntegrationTests", "Analyze result: {0}", response.Response);
8392
analyzeResponse = response.Result;
8493
Assert.IsNotNull(analyzeResponse);
94+
Assert.IsNotNull(analyzeResponse.Syntax);
8595
Assert.IsNull(error);
8696
},
8797
features: features,

Tests/SpeechToTextV1IntegrationTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ public IEnumerator TestGetAudio()
954954
getAudioResponse = response.Result;
955955
Assert.IsNotNull(getAudioResponse);
956956
Assert.IsTrue(getAudioResponse.Name == acousticResourceName);
957+
Assert.IsTrue(getAudioResponse.Duration is long?);
957958
Assert.IsNull(error);
958959
},
959960
customizationId: acousticModelCustomizationId,
@@ -979,6 +980,7 @@ public IEnumerator TestListAudio()
979980
Assert.IsNotNull(listAudioResponse);
980981
Assert.IsNotNull(listAudioResponse.Audio);
981982
Assert.IsTrue(listAudioResponse.Audio.Count > 0);
983+
Assert.IsTrue(listAudioResponse.Audio[0].Duration is long?);
982984
Assert.IsNull(error);
983985
},
984986
customizationId: acousticModelCustomizationId

0 commit comments

Comments
 (0)