Skip to content

Commit 3e0181d

Browse files
committed
test: Update tests to match generated code
1 parent 612cdae commit 3e0181d

File tree

9 files changed

+22
-24
lines changed

9 files changed

+22
-24
lines changed

examples/IBM.Watson.CompareComply.v1.Examples/ServiceExample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public void ConvertToHtml()
8080
fs.CopyTo(ms);
8181
var result = service.ConvertToHtml(
8282
file: ms,
83-
filename: Path.GetFileName("{path-to-file}"),
8483
fileContentType: "{file-content-type}"
8584
);
8685

examples/IBM.Watson.Discovery.v1.Examples/ServiceExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public void Query()
754754
filter: "{filter}",
755755
query: "{query}",
756756
aggregation: "{aggregation}",
757-
returnFields: "{return_fields}"
757+
_return: "{return_fields}"
758758
);
759759

760760
Console.WriteLine(result.Response);
@@ -790,7 +790,7 @@ public void FederatedQuery()
790790
var result = service.FederatedQuery(
791791
environmentId: "{environmentId}",
792792
naturalLanguageQuery: "{naturalLanguageQuery}",
793-
returnFields: "{returnFields}"
793+
_return: "{returnFields}"
794794
);
795795

796796
Console.WriteLine(result.Response);

examples/IBM.Watson.NaturalLangaugeClassifier.v1.Examples/ServiceExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void CreateClassifier()
129129
trainingDataFile.CopyTo(trainingData);
130130
metadataFile.CopyTo(metadata);
131131
result = service.CreateClassifier(
132-
metadata: metadata,
132+
trainingMetadata: metadata,
133133
trainingData: trainingData
134134
);
135135
}

test/Assistant.v2.UnitTests/AssistantV2UnitTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ public void Message_Success()
266266
response.Result = new MessageResponse();
267267
response.Result.Output = new MessageOutput()
268268
{
269-
Generic = new List<DialogRuntimeResponseGeneric>()
269+
Generic = new List<RuntimeResponseGeneric>()
270270
{
271-
new DialogRuntimeResponseGeneric()
271+
new RuntimeResponseGeneric()
272272
{
273-
ResponseType = DialogRuntimeResponseGeneric.ResponseTypeEnumValue.TEXT,
274-
Preference = DialogRuntimeResponseGeneric.PreferenceEnumValue.BUTTON,
273+
ResponseType = RuntimeResponseGeneric.ResponseTypeEnumValue.TEXT,
274+
Preference = RuntimeResponseGeneric.PreferenceEnumValue.BUTTON,
275275
Text = "text",
276276
Time = 1,
277277
Typing = true,

test/CompareComply.v1.IntegrationTests/CompareComplyServiceIntegrationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public void HtmlConversion_Success()
6767
service.WithHeader("X-Watson-Test", "1");
6868
var htmlConversionResult = service.ConvertToHtml(
6969
file: ms,
70-
filename: Path.GetFileName(contractAFilePath),
7170
fileContentType: "application/pdf",
7271
model: compareComplyModel
7372
);

test/Discovery.v1.IntegrationTests/DiscoveryIntegrationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public void TestQuery()
415415
environmentId: environmentId,
416416
collectionId: collectionId,
417417
naturalLanguageQuery: naturalLanguageQuery,
418-
returnFields: "extracted_metadata.sha1"
418+
_return: "extracted_metadata.sha1"
419419
);
420420

421421
service.WithHeader("X-Watson-Test", "1");
@@ -832,7 +832,7 @@ public void TestCreateEvent_Success()
832832
environmentId: environmentId,
833833
collectionId: collectionId,
834834
naturalLanguageQuery: naturalLanguageQuery,
835-
returnFields: "extracted_metadata.sha1"
835+
_return: "extracted_metadata.sha1"
836836
);
837837

838838
var data = new EventData()

test/Discovery.v1.UnitTests/DiscoveryUnitTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ public void ListConfigurations_Success()
852852
DestinationField = "destinationField",
853853
SourceField = "sourceField",
854854
Overwrite = false,
855-
EnrichmentName = "enrichmentName",
855+
_Enrichment = "enrichmentName",
856856
IgnoreDownstreamErrors = false,
857857
Options = new EnrichmentOptions()
858858
{
@@ -904,7 +904,7 @@ public void ListConfigurations_Success()
904904
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0].Description == "description");
905905
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0].SourceField == "sourceField");
906906
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0].Overwrite == false);
907-
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0].EnrichmentName == "enrichmentName");
907+
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0]._Enrichment == "enrichmentName");
908908
Assert.IsTrue(result.Result.Configurations[0].Enrichments[0].IgnoreDownstreamErrors == false);
909909
Assert.IsNotNull(result.Result.Configurations[0].Enrichments[0].Options);
910910
}
@@ -999,7 +999,7 @@ public void CreateConfiguration_Success()
999999
DestinationField = "destinationField",
10001000
SourceField = "sourceField",
10011001
Overwrite = false,
1002-
EnrichmentName = "enrichmentName",
1002+
_Enrichment = "enrichmentName",
10031003
IgnoreDownstreamErrors = false,
10041004
Options = new EnrichmentOptions()
10051005
{
@@ -1230,7 +1230,7 @@ public void GetConfiguration_Success()
12301230
DestinationField = "destinationField",
12311231
SourceField = "sourceField",
12321232
Overwrite = false,
1233-
EnrichmentName = "enrichmentName",
1233+
_Enrichment = "enrichmentName",
12341234
IgnoreDownstreamErrors = false,
12351235
Options = new EnrichmentOptions()
12361236
{
@@ -1366,7 +1366,7 @@ public void UpdateConfiguration_Success()
13661366
DestinationField = "destinationField",
13671367
SourceField = "sourceField",
13681368
Overwrite = false,
1369-
EnrichmentName = "enrichmentName",
1369+
_Enrichment = "enrichmentName",
13701370
IgnoreDownstreamErrors = false,
13711371
Options = new EnrichmentOptions()
13721372
{
@@ -1919,8 +1919,8 @@ public void ListCollectionFields_Success()
19191919

19201920
#region Response
19211921
var field = Substitute.For<Field>();
1922-
field.FieldName.Returns("field");
1923-
field.FieldType = Field.FieldTypeEnumValue.STRING;
1922+
field._Field.Returns("field");
1923+
field.Type = Field.TypeEnumValue.STRING;
19241924

19251925
DetailedResponse<ListCollectionFieldsResponse> response = new DetailedResponse<ListCollectionFieldsResponse>()
19261926
{
@@ -1948,8 +1948,8 @@ public void ListCollectionFields_Success()
19481948
client.Received().GetAsync(Arg.Any<string>());
19491949
Assert.IsNotNull(result.Result.Fields);
19501950
Assert.IsTrue(result.Result.Fields.Count > 0);
1951-
Assert.IsTrue(result.Result.Fields[0].FieldType == Field.FieldTypeEnumValue.STRING);
1952-
Assert.IsTrue(result.Result.Fields[0].FieldName == "field");
1951+
Assert.IsTrue(result.Result.Fields[0].Type == Field.TypeEnumValue.STRING);
1952+
Assert.IsTrue(result.Result.Fields[0]._Field == "field");
19531953
}
19541954
#endregion
19551955
#endregion

test/LanguageTranslator.v3.UnitTests/LanguageTranslatorServiceUnitTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public void Translate_Success_WithModel()
358358
{
359359
new Translation()
360360
{
361-
TranslationOutput = "text translated"
361+
_Translation = "text translated"
362362
}
363363
},
364364
WordCount = 1,
@@ -400,7 +400,7 @@ public void Translate_Success_With_Source_Target()
400400
{
401401
new Translation()
402402
{
403-
TranslationOutput = "text translated"
403+
_Translation = "text translated"
404404
}
405405
}
406406
}
@@ -440,7 +440,7 @@ public void Translate_Success_With_Source_Target_List()
440440
{
441441
new Translation()
442442
{
443-
TranslationOutput = "text translated"
443+
_Translation = "text translated"
444444
}
445445
}
446446
}

test/NaturalLanguageClassifier.v1.IntegrationTests/NaturalLanguageClassifierServiceIntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void TestClassifiers_Success()
9898
metadataFile.CopyTo(metadata);
9999
service.WithHeader("X-Watson-Test", "1");
100100
createClassifierResult = service.CreateClassifier(
101-
metadata: metadata,
101+
trainingMetadata: metadata,
102102
trainingData: trainingData
103103
);
104104
}

0 commit comments

Comments
 (0)