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); }
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)); }