public void correctly_applies_small_tsu()
        {
            converter = new RomajiHiraganaConverter();
            string input    = "ippun,nippon,teppan,itta,yatteimasu";
            string expected = "いっぷん,にっぽん,てっぱん,いった,やっています";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
        public void converts_jyo()
        {
            converter = new RomajiHiraganaConverter();
            string input    = "daijyoubu";
            string expected = "だいじょうぶ";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
        public void doesnt_convert_non_kana_characters()
        {
            converter = new RomajiHiraganaConverter();
            string input    = "watashinonamaehamaikudesu.douzoyoroshiku.Ne,onigirihaoishiine!";
            string expected = "わたしのなまえはまいくです.どうぞよろしく.ね,おにぎりはおいしいね!";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
        public void can_convert_hiragana_vocalized_syllables()
        {
            converter = new RomajiHiraganaConverter();
            string input    = "gagigugego";
            string expected = "がぎぐげご";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
        public void can_convert_the_katakana_table()
        {
            converter = new RomajiKatakanaConverter();
            string input    = "aiueokakikukekosashisuseso";
            string expected = "アイウエオカキクケコサシスセソ";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
        public void can_convert_the_hiragana_table()
        {
            converter = new RomajiHiraganaConverter();
            string input    = "aiueokakikukekosashisuseso";
            string expected = "あいうえおかきくけこさしすせそ";
            string result   = converter.Convert(input);

            Assert.AreEqual(expected, result);
        }
Beispiel #7
0
        public void converts_from_kat_to_hir()
        {
            converter = new KanaKanaConverter();
            string hir    = "あいうえおかきくけこさしすせそきゃびゃぎゃ";
            string kat    = "アイウエオカキクケコサシスセソキャビャギャ";
            string result = converter.Convert(kat);

            Assert.AreEqual(hir, result);
        }
Beispiel #8
0
        public void removes_small_tsu_from_hiragana()
        {
            string input = "にっぽん、てっぱんやき";

            converter = KanaConverter.GetConverter(input);
            string result   = converter.Convert(input);
            string expected = "nippon、teppanyaki";

            Assert.AreEqual(expected, result);
        }
        public void gets_auto_converter_and_converts()
        {
            // to simulate how it would be consumed. This is why
            // you start with Test Driven Development, so you don't
            // try 3 ways of doing something.
            string         text      = "gakkou"; // received from text input
            IKanaConverter converter = KanaConverterLib.KanaConverter.GetConverter(text);
            string         result    = converter.Convert(text);
            string         expected  = "がっこう";

            Assert.AreEqual(expected, result);
        }