Skip to content

Commit f91a64e

Browse files
committed
test(discovery): fixed some tests to read from result instead of response
1 parent 0d49994 commit f91a64e

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

test/IBM.WatsonDeveloperCloud.Discovery.v1.UnitTests/DiscoveryUnitTests.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,18 +3060,18 @@ public void ListTrainingData_Success()
30603060

30613061
Assert.IsNotNull(result);
30623062
client.Received().GetAsync(Arg.Any<string>());
3063-
Assert.IsTrue(response.EnvironmentId == "environmentId");
3064-
Assert.IsTrue(response.CollectionId == "collectionId");
3065-
Assert.IsNotNull(response.Queries);
3066-
Assert.IsTrue(response.Queries.Count > 0);
3067-
Assert.IsTrue(response.Queries[0].QueryId == "queryId");
3068-
Assert.IsTrue(response.Queries[0].NaturalLanguageQuery == "naturalLanguageQuery");
3069-
Assert.IsTrue(response.Queries[0].Filter == "filter");
3070-
Assert.IsNotNull(response.Queries[0].Examples);
3071-
Assert.IsTrue(response.Queries[0].Examples.Count > 0);
3072-
Assert.IsTrue(response.Queries[0].Examples[0].DocumentId == "documentId");
3073-
Assert.IsTrue(response.Queries[0].Examples[0].CrossReference == "crossReference");
3074-
Assert.IsTrue(response.Queries[0].Examples[0].Relevance == 1.0f);
3063+
Assert.IsTrue(result.EnvironmentId == "environmentId");
3064+
Assert.IsTrue(result.CollectionId == "collectionId");
3065+
Assert.IsNotNull(result.Queries);
3066+
Assert.IsTrue(result.Queries.Count > 0);
3067+
Assert.IsTrue(result.Queries[0].QueryId == "queryId");
3068+
Assert.IsTrue(result.Queries[0].NaturalLanguageQuery == "naturalLanguageQuery");
3069+
Assert.IsTrue(result.Queries[0].Filter == "filter");
3070+
Assert.IsNotNull(result.Queries[0].Examples);
3071+
Assert.IsTrue(result.Queries[0].Examples.Count > 0);
3072+
Assert.IsTrue(result.Queries[0].Examples[0].DocumentId == "documentId");
3073+
Assert.IsTrue(result.Queries[0].Examples[0].CrossReference == "crossReference");
3074+
Assert.IsTrue(result.Queries[0].Examples[0].Relevance == 1.0f);
30753075
}
30763076
#endregion
30773077

@@ -3359,14 +3359,14 @@ public void GetTrainingData_Success()
33593359

33603360
Assert.IsNotNull(result);
33613361
client.Received().GetAsync(Arg.Any<string>());
3362-
Assert.IsTrue(response.QueryId == "queryId");
3363-
Assert.IsTrue(response.NaturalLanguageQuery == "naturalLanguageQuery");
3364-
Assert.IsTrue(response.Filter == "filter");
3365-
Assert.IsNotNull(response.Examples);
3366-
Assert.IsTrue(response.Examples.Count > 0);
3367-
Assert.IsTrue(response.Examples[0].DocumentId == "documentId");
3368-
Assert.IsTrue(response.Examples[0].CrossReference == "crossReference");
3369-
Assert.IsTrue(response.Examples[0].Relevance == 1.0f);
3362+
Assert.IsTrue(result.QueryId == "queryId");
3363+
Assert.IsTrue(result.NaturalLanguageQuery == "naturalLanguageQuery");
3364+
Assert.IsTrue(result.Filter == "filter");
3365+
Assert.IsNotNull(result.Examples);
3366+
Assert.IsTrue(result.Examples.Count > 0);
3367+
Assert.IsTrue(result.Examples[0].DocumentId == "documentId");
3368+
Assert.IsTrue(result.Examples[0].CrossReference == "crossReference");
3369+
Assert.IsTrue(result.Examples[0].Relevance == 1.0f);
33703370
}
33713371
#endregion
33723372

@@ -3400,7 +3400,7 @@ public void CreateTrainingExample_No_QueryId()
34003400
public void CreateTrainingExample_No_Body()
34013401
{
34023402
DiscoveryService service = new DiscoveryService("username", "password", "versionDate");
3403-
service.CreateTrainingExample("environmentId", "collectionId", "queryId",null);
3403+
service.CreateTrainingExample("environmentId", "collectionId", "queryId", null);
34043404
}
34053405

34063406
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
@@ -3648,9 +3648,9 @@ public void GetTrainingExample_Success()
36483648

36493649
Assert.IsNotNull(result);
36503650
client.Received().GetAsync(Arg.Any<string>());
3651-
Assert.IsTrue(response.DocumentId == "documentId");
3652-
Assert.IsTrue(response.CrossReference == "crossReference");
3653-
Assert.IsTrue(response.Relevance == 1.0f);
3651+
Assert.IsTrue(result.DocumentId == "documentId");
3652+
Assert.IsTrue(result.CrossReference == "crossReference");
3653+
Assert.IsTrue(result.Relevance == 1.0f);
36543654
}
36553655
#endregion
36563656

0 commit comments

Comments
 (0)