public void MTEdgeApi_FetchTranslationEmoji_ValidTranslation() { var file = new File { SourceCulture = engFraLP.SourceCulture, TargetCulture = engFraLP.TargetCulture }; var xliffDocument = new Xliff { File = file }; xliffDocument.AddSourceText(UTStringResource.BasicEmojiTest); xliffDocument.Version = "v1.0"; var translatedXliffText = SDLMTEdgeTranslatorHelper.GetTranslation(apiKeyTranslationOptions, engFraLP, xliffDocument); var translatedXliff = Converter.ParseXliffString(translatedXliffText); Assert.IsTrue(translatedXliff.GetTargetSegments().Any()); Assert.AreEqual(UTStringResource.BasicEmojiTranslation, translatedXliff.GetTargetSegments()[0].ToString()); }
public void MTEdgeApi_FetchTranslationNoTags_ValidTranslation() { var xliffDocument = new Xliff(engFraLP.SourceCulture, engFraLP.TargetCulture); xliffDocument.AddSourceText(UTStringResource.BasicText); var translatedXliffText = SDLMTEdgeTranslatorHelper.GetTranslation(apiKeyTranslationOptions, engFraLP, xliffDocument); var translatedXliff = Toolkit.LanguagePlatform.XliffConverter.Converter.ParseXliffString(translatedXliffText); Assert.IsTrue(translatedXliff.GetTargetSegments().Any()); Assert.AreEqual(UTStringResource.BasicTranslation, translatedXliff.GetTargetSegments()[0].ToString()); var token = SDLMTEdgeTranslatorHelper.GetAuthToken(basicAuthTranslationOptions, userCredentials); basicAuthTranslationOptions.ApiToken = token; translatedXliffText = SDLMTEdgeTranslatorHelper.GetTranslation(basicAuthTranslationOptions, engFraLP, xliffDocument); translatedXliff = Toolkit.LanguagePlatform.XliffConverter.Converter.ParseXliffString(translatedXliffText); Assert.IsTrue(translatedXliff.GetTargetSegments().Any()); Assert.AreEqual(UTStringResource.BasicTranslation, translatedXliff.GetTargetSegments()[0].ToString()); }