Exemplo n.º 1
0
        public void TestRemoveTextTag(string[] textTags, string removeTextTag, bool actual)
        {
            var lyric = new Lyric
            {
                Text       = "からおけ",
                RubyTags   = TestCaseTagHelper.ParseRubyTags(textTags),
                RomajiTags = TestCaseTagHelper.ParseRomajiTags(textTags)
            };

            var fromIndex = textTags?.IndexOf(removeTextTag) ?? -1;

            // test ruby and romaji at the same test.
            var removeRubyTag   = fromIndex >= 0 ? lyric.RubyTags[fromIndex] : TestCaseTagHelper.ParseRubyTag(removeTextTag);
            var removeRomajiTag = fromIndex >= 0 ? lyric.RomajiTags[fromIndex] : TestCaseTagHelper.ParseRomajiTag(removeTextTag);

            Assert.AreEqual(LyricUtils.RemoveTextTag(lyric, removeRubyTag), actual);
            Assert.AreEqual(LyricUtils.RemoveTextTag(lyric, removeRomajiTag), actual);
        }