Esempio n. 1
0
        public void TranslateTest()
        {
            Assert.AreEqual("_.\t_...\t_._.\t", translator.Translate("ABC"));

            Assert.AreEqual("_.\t._..\t_.\t__\t_.\t_._\t___\t_\t_.\t", translator.Translate("Ala Ma Kota"));

            Assert.AreEqual("_.\t._..\t_.\t__\t_.\t_._\t___\t_\t_.\t", translator.Translate("Ala Ma Kota"));

            Assert.AreEqual("ERROR: Text contains invalid characters", translator.Translate("!@$"));
        }
Esempio n. 2
0
        private void TranslateButton_Click(object sender, EventArgs e)
        {
            TranslatorFromAlphabet translator = new TranslatorFromAlphabet();

            textToTranslate = inputText.Text;
            translatedText  = translator.Translate(textToTranslate);
            outputText.Text = translatedText;
        }