public async Task NullArgumentAsyncChecks()
        {
            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.DetectLanguageAsync(null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.DetectLanguagesAsync(null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateTextAsync((string)null, "en"));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateTextAsync((IEnumerable <string>)null, "en"));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateHtmlAsync((string)null, "en"));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateHtmlAsync((IEnumerable <string>)null, "en"));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateTextAsync("text", null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateTextAsync(new[] { "text" }, null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateHtmlAsync("html", null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => ThrowingServiceClient.TranslateHtmlAsync(new[] { "html" }, null));
        }
        public async Task DetectLanguagesAsync()
        {
            // Sample: DetectLanguages
            // Additional: DetectLanguagesAsync(IEnumerable<string>, CancellationToken)
            AdvancedTranslationClient client  = AdvancedTranslationClient.Create();
            IList <Detection>         results = await client.DetectLanguagesAsync(new[] { "It is raining.", "Il pleut." });

            foreach (var result in results)
            {
                Console.WriteLine($"Text: {result.Text}; language: {result.Language}; confidence {result.Confidence}");
            }
            // End sample

            Assert.Equal("en", results[0].Language);
            Assert.Equal("It is raining.", results[0].Text);
            Assert.Equal("fr", results[1].Language);
            Assert.Equal("Il pleut.", results[1].Text);
        }