diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatus.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatus.cs index 9a4bc05675a95..49e14990455db 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatus.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatus.cs @@ -19,21 +19,10 @@ public void DocumentStatus() string apiKey = TestEnvironment.ApiKey; Uri sourceUrl = new Uri(TestEnvironment.SourceUrl); Uri targetUrl = new Uri(TestEnvironment.TargetUrl); - Uri glossaryUrl = new Uri(TestEnvironment.GlossaryUrl); var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); - var glossaries = new List() - { - new TranslationGlossary(glossaryUrl) - }; - - var options = new TranslationOperationOptions - { - StorageType = StorageType.Folder - }; - - DocumentTranslationOperation operation = client.StartTranslation(sourceUrl, targetUrl, "it", glossaries, options); + DocumentTranslationOperation operation = client.StartTranslation(sourceUrl, targetUrl, "it"); var documentscompleted = new HashSet(); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatusAsync.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatusAsync.cs index 8fbae174cac09..90aa87a68419a 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatusAsync.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_DocumentStatusAsync.cs @@ -20,21 +20,10 @@ public async Task DocumentStatusAsync() string apiKey = TestEnvironment.ApiKey; Uri sourceUrl = new Uri(TestEnvironment.SourceUrl); Uri targetUrl = new Uri(TestEnvironment.TargetUrl); - Uri glossaryUrl = new Uri(TestEnvironment.GlossaryUrl); var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); - var glossaries = new List() - { - new TranslationGlossary(glossaryUrl) - }; - - var options = new TranslationOperationOptions - { - StorageType = StorageType.Folder - }; - - DocumentTranslationOperation operation = client.StartTranslation(sourceUrl, targetUrl, "it", glossaries, options); + DocumentTranslationOperation operation = client.StartTranslation(sourceUrl, targetUrl, "it"); var documentscompleted = new HashSet(); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistory.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistory.cs index e6c62a316d4c6..9f98134d7ec4c 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistory.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistory.cs @@ -41,9 +41,10 @@ public void OperationsHistory() } } - Console.WriteLine($"# of operations: {operationsCount}\nTotal Documents: {totalDocs}\n" - + $"DocumentsSucceeded: {docsSucceeded}\n" - + $"Cancelled Documents: {docsCancelled}"); + Console.WriteLine($"# of operations: {operationsCount}"); + Console.WriteLine($"Total Documents: {totalDocs}"); + Console.WriteLine($"DocumentsSucceeded: {docsSucceeded}"); + Console.WriteLine($"Cancelled Documents: {docsCancelled}"); Console.WriteLine($"Largest operation is {largestOperation.Id} and has the documents:"); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistoryAsync.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistoryAsync.cs index 0c08be98f4e3a..a4437581bf73a 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistoryAsync.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_OperationsHistoryAsync.cs @@ -41,9 +41,10 @@ public async Task OperationsHistoryAsync() } } - Console.WriteLine($"# of operations: {operationsCount}\nTotal Documents: {totalDocs}\n" - + $"DocumentsSucceeded: {docsSucceeded}\n" - + $"Cancelled Documents: {docsCancelled}"); + Console.WriteLine($"# of operations: {operationsCount}"); + Console.WriteLine($"Total Documents: {totalDocs}"); + Console.WriteLine($"DocumentsSucceeded: {docsSucceeded}"); + Console.WriteLine($"Cancelled Documents: {docsCancelled}"); Console.WriteLine($"Largest operation is {largestOperation} and has the documents:"); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperation.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperation.cs index c7f67bf8941d5..69ed7c5e6bc5e 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperation.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperation.cs @@ -20,7 +20,6 @@ public void TranslateOperation() string apiKey = TestEnvironment.ApiKey; Uri sourceUrl = new Uri(TestEnvironment.SourceUrl); Uri targetUrl = new Uri(TestEnvironment.TargetUrl); - Uri glossaryUrl = new Uri(TestEnvironment.GlossaryUrl); var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationAsync.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationAsync.cs index eceef74bc4fe8..a90bb69d76fa1 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationAsync.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationAsync.cs @@ -20,7 +20,6 @@ public async Task TranslateOperationAsync() string apiKey = TestEnvironment.ApiKey; Uri sourceUrl = new Uri(TestEnvironment.SourceUrl); Uri targetUrl = new Uri(TestEnvironment.TargetUrl); - Uri glossaryUrl = new Uri(TestEnvironment.GlossaryUrl); var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); diff --git a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationComplex.cs b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationComplex.cs index 57fa1b47233c9..ad5b18f99b7d7 100644 --- a/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationComplex.cs +++ b/sdk/documenttranslation/Azure.AI.DocumentTranslation/tests/samples/Sample_TranslateOperationComplex.cs @@ -18,32 +18,30 @@ public void TranslateOperationComplex() { string endpoint = TestEnvironment.Endpoint; string apiKey = TestEnvironment.ApiKey; - string sourceUrl = TestEnvironment.SourceUrl; - string targetUrl = TestEnvironment.TargetUrl; + string sourceUrl1 = TestEnvironment.SourceUrl; + string sourceUrl2 = TestEnvironment.SourceUrl; + string targetUrl1 = TestEnvironment.TargetUrl; + string targetUrl2 = TestEnvironment.TargetUrl; Uri glossaryUrl = new Uri(TestEnvironment.GlossaryUrl); var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); - var input1 = new TranslationConfiguration( - new SourceConfiguration(sourceUrl), - new List() - { - new TargetConfiguration(targetUrl, "it", new List {new TranslationGlossary(glossaryUrl)}) - }, - StorageType.Folder); + var glossaries = new List() { new TranslationGlossary(glossaryUrl) }; - var input2 = new TranslationConfiguration( - new SourceConfiguration(targetUrl), - new List() - { - new TargetConfiguration(sourceUrl, "en", new List {new TranslationGlossary(glossaryUrl)}) - }, - StorageType.Folder); + var configuration1 = new TranslationConfiguration( + source: new SourceConfiguration(sourceUrl1), + targets: new List() { new TargetConfiguration(targetUrl1, "it", glossaries) }, + storageType: StorageType.Folder); + + var configuration2 = new TranslationConfiguration( + source: new SourceConfiguration(sourceUrl2), + targets: new List() { new TargetConfiguration(targetUrl2, "it", glossaries) }, + storageType: StorageType.Folder); var inputs = new List() { - input1, - input2 + configuration1, + configuration2 }; DocumentTranslationOperation operation = client.StartTranslation(inputs);