//[TestMethod] public void TestCreateEnrichment() { // Create Enrichment CreateEnrichment createEnrichment = new CreateEnrichment(); createEnrichment.Name = "Dictionary1"; createEnrichment.Description = "test dictionary"; createEnrichment.Type = CreateEnrichment.TypeEnumValue.DICTIONARY; createEnrichment.Options = new EnrichmentOptions(); createEnrichment.Options.Languages = new List <string>(); createEnrichment.Options.Languages.Add("en"); createEnrichment.Options.EntityType = "keyword"; service.WithHeader("X-Watson-Test", "1"); using (FileStream fs = File.OpenRead(enrichmentFile)) { using (MemoryStream ms = new MemoryStream()) { fs.CopyTo(ms); var createEnrichmentResult = service.CreateEnrichment( projectId: projectId, enrichment: createEnrichment, file: ms ); Assert.IsNotNull(createEnrichmentResult.Response); // Delete Enrichment var deleteEnrichmentResult = service.DeleteEnrichment( projectId: projectId, enrichmentId: createEnrichmentResult.Result.EnrichmentId ); Assert.IsNotNull(deleteEnrichmentResult); Assert.IsTrue(deleteEnrichmentResult.StatusCode == 204); } } }
public IEnumerator TestDeleteEnrichment() { Log.Debug("DiscoveryServiceV2IntegrationTests", "Attempting to DeleteEnrichment..."); bool deleteEnrichmentResponse = false; service.DeleteEnrichment( callback: (DetailedResponse <object> response, IBMError error) => { Log.Debug("DiscoveryServiceV2IntegrationTests", "DeleteEnrichment result: {0}", response.Response); deleteEnrichmentResponse = true; Assert.IsNull(error); }, projectId: projectId, enrichmentId: enrichmentId ); while (!deleteEnrichmentResponse) { yield return(null); } }