Skip to content

Commit ebc7369

Browse files
committed
chore(Tests and Examples): Update tests and examples based on latest regeneration
1 parent 2d09e7a commit ebc7369

File tree

5 files changed

+1
-419
lines changed

5 files changed

+1
-419
lines changed

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

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ static void Main(string[] args)
6767
example.GetConfiguration();
6868
example.UpdateConfiguration();
6969

70-
example.TestConfigurationInEnvironment();
71-
7270
example.ListCollections();
7371
example.CreateCollection();
7472
example.GetCollection();
@@ -91,8 +89,6 @@ static void Main(string[] args)
9189
example.QueryNotices();
9290
example.FederatedQuery();
9391
example.FederatedQueryNotices();
94-
example.QueryEntities();
95-
example.QueryRelations();
9692

9793
example.ListTrainingData();
9894
example.AddTrainingData();
@@ -324,34 +320,6 @@ public void DeleteConfiguration()
324320
}
325321
#endregion
326322

327-
#region Test Configuration in Environment
328-
public void TestConfigurationInEnvironment()
329-
{
330-
IamAuthenticator authenticator = new IamAuthenticator(
331-
apikey: "{apikey}");
332-
333-
DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);
334-
service.SetServiceUrl("{serviceUrl}");
335-
336-
using (FileStream fs = File.OpenRead("{path_to_document}"))
337-
{
338-
using (MemoryStream ms = new MemoryStream())
339-
{
340-
fs.CopyTo(ms);
341-
var result = service.TestConfigurationInEnvironment(
342-
environmentId: "{environmentId}",
343-
configurationId: "{configurationId}",
344-
file: ms,
345-
filename: "{test_file}",
346-
fileContentType: "{document_content_type}"
347-
);
348-
349-
Console.WriteLine(result.Response);
350-
}
351-
}
352-
}
353-
#endregion
354-
355323
#region Collections
356324
public void ListCollections()
357325
{
@@ -789,6 +757,7 @@ public void FederatedQuery()
789757

790758
var result = service.FederatedQuery(
791759
environmentId: "{environmentId}",
760+
collectionIds: "{collectionIds}",
792761
naturalLanguageQuery: "{naturalLanguageQuery}",
793762
_return: "{returnFields}"
794763
);
@@ -812,38 +781,6 @@ public void FederatedQueryNotices()
812781

813782
Console.WriteLine(result.Response);
814783
}
815-
816-
public void QueryEntities()
817-
{
818-
IamAuthenticator authenticator = new IamAuthenticator(
819-
apikey: "{apikey}");
820-
821-
DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);
822-
service.SetServiceUrl("{serviceUrl}");
823-
824-
var result = service.QueryEntities(
825-
environmentId: "{environmentId}",
826-
collectionId: "{collectionId}"
827-
);
828-
829-
Console.WriteLine(result.Response);
830-
}
831-
832-
public void QueryRelations()
833-
{
834-
IamAuthenticator authenticator = new IamAuthenticator(
835-
apikey: "{apikey}");
836-
837-
DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);
838-
service.SetServiceUrl("{serviceUrl}");
839-
840-
var result = service.QueryRelations(
841-
environmentId: "{environmentId}",
842-
collectionId: "{collectionId}"
843-
);
844-
845-
Console.WriteLine(result.Response);
846-
}
847784
#endregion
848785

849786
#region Training Data

examples/IBM.Watson.VisualRecognition.v3.Examples/ServiceExample.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static void Main(string[] args)
4545
ServiceExample example = new ServiceExample();
4646

4747
example.Classify();
48-
example.DetectFaces();
4948

5049
example.ListClassifiers();
5150
example.CreateClassifier();
@@ -90,30 +89,6 @@ public void Classify()
9089
}
9190
#endregion
9291

93-
#region Face
94-
public void DetectFaces()
95-
{
96-
IamAuthenticator authenticator = new IamAuthenticator(
97-
apikey: "{apikey}");
98-
99-
VisualRecognitionService service = new VisualRecognitionService("2018-03-19", authenticator);
100-
101-
DetailedResponse<DetectedFaces> result;
102-
using (FileStream fs = File.OpenRead("./Ginni_Rometty.jpg"))
103-
{
104-
using (MemoryStream ms = new MemoryStream())
105-
{
106-
fs.CopyTo(ms);
107-
result = service.DetectFaces(
108-
imagesFile: ms
109-
);
110-
}
111-
112-
}
113-
Console.WriteLine(result.Response);
114-
}
115-
#endregion
116-
11792
#region Custom
11893
public void ListClassifiers()
11994
{

test/Discovery.v1.IntegrationTests/DiscoveryIntegrationTests.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -237,45 +237,6 @@ public void TestCollections_Success()
237237
}
238238
#endregion
239239

240-
#region Preview Environment
241-
[TestMethod]
242-
public void PreviewEnvironment()
243-
{
244-
service.WithHeader("X-Watson-Test", "1");
245-
var createConfigurationResults = service.CreateConfiguration(
246-
environmentId: environmentId,
247-
name: createdConfigurationName,
248-
description: createdConfigurationDescription
249-
);
250-
251-
configurationId = createConfigurationResults.Result.ConfigurationId;
252-
253-
using (FileStream fs = File.OpenRead(filepathToIngest))
254-
{
255-
using (MemoryStream ms = new MemoryStream())
256-
{
257-
fs.CopyTo(ms);
258-
service.WithHeader("X-Watson-Test", "1");
259-
var testConfigurationInEnvironmentResult = service.TestConfigurationInEnvironment(
260-
environmentId: environmentId,
261-
configurationId: configurationId,
262-
file: ms, filename: "watson_beats_jeopardy.html",
263-
fileContentType: "text/html"
264-
);
265-
266-
service.WithHeader("X-Watson-Test", "1");
267-
var deleteConfigurationResults = service.DeleteConfiguration(
268-
environmentId: environmentId,
269-
configurationId: configurationId
270-
);
271-
272-
Assert.IsNotNull(testConfigurationInEnvironmentResult.Result);
273-
Assert.IsNotNull(testConfigurationInEnvironmentResult.Result.Status);
274-
}
275-
}
276-
}
277-
#endregion
278-
279240
#region Documents
280241
[TestMethod]
281242
public void TestDocuments_Success()

0 commit comments

Comments
 (0)