public void TestFindNoneTime(string[] timeTagTexts, string[] invalidTimeTags) { var timeTags = TestCaseTagHelper.ParseTimeTags(timeTagTexts); var outOfRangeTimeTags = TimeTagsUtils.FindNoneTime(timeTags); TimeTagAssert.ArePropertyEqual(outOfRangeTimeTags, TestCaseTagHelper.ParseTimeTags(invalidTimeTags)); }
public void TestSort(string[] timeTagTexts, string[] actualTimeTags) { var timeTags = TestCaseTagHelper.ParseTimeTags(timeTagTexts); var sortedTimeTag = TimeTagsUtils.Sort(timeTags); TimeTagAssert.ArePropertyEqual(sortedTimeTag, TestCaseTagHelper.ParseTimeTags(actualTimeTags)); }
//[TestCase(new[] { "[0,start]:4000", "[0,end]:3000", "[1,start]:2000", "[1,end]:1000" }, GroupCheck.Asc, SelfCheck.BasedOnStart, new double[] { "[0,start]:4000", "[0,end]:4000", "[1,start]:4000", "[1,end]:4000" })] //[TestCase(new[] { "[0,start]:4000", "[0,end]:3000", "[1,start]:2000", "[1,end]:1000" }, GroupCheck.Asc, SelfCheck.BasedOnEnd, new double[] { "[0,start]:3000", "[0,end]:3000", "[1,start]:3000", "[1,end]:3000" })] //[TestCase(new[] { "[0,start]:4000", "[0,end]:3000", "[1,start]:2000", "[1,end]:1000" }, GroupCheck.Desc, SelfCheck.BasedOnStart, new double[] { "[0,start]:2000", "[0,end]:2000", "[1,start]:2000", "[1,end]:2000" })] //[TestCase(new[] { "[0,start]:4000", "[0,end]:3000", "[1,start]:2000", "[1,end]:1000" }, GroupCheck.Desc, SelfCheck.BasedOnEnd, new double[] { "[0,start]:1000", "[0,end]:1000", "[1,start]:1000", "[1,end]:1000" })] public void TestFixOverlapping(string[] timeTagTexts, GroupCheck other, SelfCheck self, string[] actualTimeTagTexts) { // check which part is fixed, using list of time to check result. var timeTags = TestCaseTagHelper.ParseTimeTags(timeTagTexts); var fixedTimeTag = TimeTagsUtils.FixOverlapping(timeTags, other, self); TimeTagAssert.ArePropertyEqual(fixedTimeTag, TestCaseTagHelper.ParseTimeTags(actualTimeTagTexts)); }
public void TestLyricTimeTag(string text, string[] timeTags) { var beatmap = decodeLrcLine(text); // Get first lyric from beatmap var lyric = beatmap.HitObjects.OfType <Lyric>().FirstOrDefault(); // Check time tag TimeTagAssert.ArePropertyEqual(lyric?.TimeTags, TestCaseTagHelper.ParseTimeTags(timeTags)); }
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.ArePropertyEqual(lyric.TimeTags, TestCaseTagHelper.ParseTimeTags(actualTimeTags)); }
protected void RunTimeTagCheckTest(Lyric lyric, string[] actualTimeTags, TConfig config) { var generator = Activator.CreateInstance(typeof(TTimeTagGenerator), config) as TTimeTagGenerator; // create time tag and actually time tag. var timeTags = generator?.CreateTimeTags(lyric); var actualIndexed = TestCaseTagHelper.ParseTimeTags(actualTimeTags); // check should be equal TimeTagAssert.ArePropertyEqual(timeTags, actualIndexed); }
[TestCase(3081, "hello", null)] // English public void TestCreateTimeTag(int lcid, string text, string[] actualTimeTag) { var lyric = new Lyric { Language = new CultureInfo(lcid), Text = text, }; var selector = new TimeTagGeneratorSelector(); var generatedTimeTags = selector.GenerateTimeTags(lyric); TimeTagAssert.ArePropertyEqual(generatedTimeTags, TestCaseTagHelper.ParseTimeTags(actualTimeTag)); }
public void TestSeparateLyricTimeTag(string text, string[] timeTags, int splitIndex, string[] firstTimeTags, string[] secondTimeTags) { var lyric = new Lyric { Text = text, TimeTags = TestCaseTagHelper.ParseTimeTags(timeTags) }; var(firstLyric, secondLyric) = LyricsUtils.SplitLyric(lyric, splitIndex); TimeTagAssert.ArePropertyEqual(firstLyric.TimeTags, TestCaseTagHelper.ParseTimeTags(firstTimeTags)); TimeTagAssert.ArePropertyEqual(secondLyric.TimeTags, TestCaseTagHelper.ParseTimeTags(secondTimeTags)); }