public void PreProcessor_DetectPreprocess() { IPreProcessor preProcesor = new TranslatorPreProcessor(); var sentence = "salut <literal>Jean Bouchier mon ami</literal>"; sentence = preProcesor.PreprocessMessage(sentence); Assert.AreEqual("salut Jean Bouchier mon ami ", sentence); }
public void PreProcessor_TranslatePreprocess() { IPreProcessor preProcesor = new TranslatorPreProcessor(); var sentence = "salut <literal>Jean Bouchier mon ami</literal>"; preProcesor.PreprocessMessage(sentence, out var processedTextToTranslate, out var noTranslatePhrases); Assert.AreEqual("salut Jean Bouchier mon ami ", processedTextToTranslate); Assert.IsTrue(noTranslatePhrases.Contains("(Jean Bouchier mon ami)")); Assert.AreEqual(1, noTranslatePhrases.Count); }