예제 #1
0
        public async Task TranslationNotEmptyTest(string text, string toLanguage, string fromLanguage = "auto-detect")
        {
            // Act
            var results = await BingTranslatorApi.TranslateAsync(text, toLanguage, fromLanguage);

            // Assert
            Assert.NotEmpty(results);
            Assert.NotEmpty(results[0].Translations);
        }
예제 #2
0
 public async Task TranslationInvalidParamsTest(string text, string toLanguage, string fromLanguage = "auto-detect")
 {
     // Act and Assert
     await Assert.ThrowsAnyAsync <ArgumentException>(async() => await BingTranslatorApi.TranslateAsync(text, toLanguage, fromLanguage));
 }