Esempio n. 1
0
        public void TestRemoveTextTimeTag(string[] timeTags, int position, int count, string[] actualTimeTags)
        {
            var lyric = new Lyric
            {
                Text     = "カラオケ",
                TimeTags = TestCaseTagHelper.ParseTimeTags(timeTags),
            };

            LyricUtils.RemoveText(lyric, position, count);
            TimeTagAssert.AreEqual(lyric.TimeTags, TestCaseTagHelper.ParseTimeTags(actualTimeTags));
        }
Esempio n. 2
0
        public void TestRemoveTextRomaji(string[] romajies, int position, int count, string[] targetRomajies)
        {
            var lyric = new Lyric
            {
                Text       = "カラオケ",
                RomajiTags = TestCaseTagHelper.ParseRomajiTags(romajies),
            };

            LyricUtils.RemoveText(lyric, position, count);
            Assert.AreEqual(lyric.RomajiTags, TestCaseTagHelper.ParseRomajiTags(targetRomajies));
        }
Esempio n. 3
0
        public void TestRemoveTextRuby(string[] rubies, int position, int count, string[] targetRubies)
        {
            var lyric = new Lyric
            {
                Text     = "カラオケ",
                RubyTags = TestCaseTagHelper.ParseRubyTags(rubies),
            };

            LyricUtils.RemoveText(lyric, position, count);
            TextTagAssert.ArePropertyEqual(lyric.RubyTags, TestCaseTagHelper.ParseRubyTags(targetRubies));
        }
Esempio n. 4
0
 public void TestRemoveTextText(string text, int position, int count, string actualText)
 {
     try
     {
         var lyric = new Lyric {
             Text = text
         };
         LyricUtils.RemoveText(lyric, position, count);
         Assert.AreEqual(lyric.Text, actualText);
     }
     catch
     {
         Assert.Null(actualText);
     }
 }
Esempio n. 5
0
        public bool DeleteLyricText(Lyric lyric, int index)
        {
            if (index <= 0)
            {
                return(false);
            }

            changeHandler?.BeginChange();

            LyricUtils.RemoveText(lyric, index - 1);

            changeHandler?.EndChange();

            return(true);
        }
Esempio n. 6
0
        public bool DeleteLyricText(Lyric lyric, int index)
        {
            if (index <= 0)
            {
                return(false);
            }

            changeHandler?.BeginChange();

            LyricUtils.RemoveText(lyric, index - 1);

            if (string.IsNullOrEmpty(lyric.Text))
            {
                OrderUtils.ShiftingOrder(Lyrics.Where(x => x.Order > lyric.Order).ToArray(), -1);
                beatmap.Remove(lyric);
            }

            changeHandler?.EndChange();

            return(true);
        }