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)); }
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)); }
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)); }
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); } }
public bool DeleteLyricText(Lyric lyric, int index) { if (index <= 0) { return(false); } changeHandler?.BeginChange(); LyricUtils.RemoveText(lyric, index - 1); changeHandler?.EndChange(); return(true); }
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); }