Пример #1
0
        public void TestSort(string[] timeTagTexts, string[] actualTimeTags)
        {
            var timeTags      = TestCaseTagHelper.ParseTimeTags(timeTagTexts);
            var sortedTimeTag = TimeTagsUtils.Sort(timeTags);

            TimeTagAssert.AreEqual(sortedTimeTag, TestCaseTagHelper.ParseTimeTags(actualTimeTags));
        }
Пример #2
0
        public void TestFindOutOfRange(string text, string[] timeTagTexts, string[] invalidTimeTags)
        {
            var timeTags           = TestCaseTagHelper.ParseTimeTags(timeTagTexts);
            var outOfRangeTimeTags = TimeTagsUtils.FindOutOfRange(timeTags, text);

            TimeTagAssert.AreEqual(outOfRangeTimeTags, TestCaseTagHelper.ParseTimeTags(invalidTimeTags));
        }
Пример #3
0
        //[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 TestFixInvalid(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.FixInvalid(timeTags, other, self);

            TimeTagAssert.AreEqual(fixedTimeTag, TestCaseTagHelper.ParseTimeTags(actualTimeTagTexts));
        }
Пример #4
0
        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));
        }
Пример #5
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));
        }
Пример #6
0
        public void TestAddTextTimeTag(string[] timeTags, int position, string addedText, string[] actualTimeTags)
        {
            var lyric = new Lyric
            {
                Text     = "カラオケ",
                TimeTags = TestCaseTagHelper.ParseTimeTags(timeTags),
            };

            LyricUtils.AddText(lyric, position, addedText);
            TimeTagAssert.ArePropertyEqual(lyric.TimeTags, TestCaseTagHelper.ParseTimeTags(actualTimeTags));
        }
Пример #7
0
        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.AreEqual(timeTags, actualIndexed);
        }
Пример #8
0
        [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.AreEqual(generatedTimeTags, TestCaseTagHelper.ParseTimeTags(actualTimeTag));
        }
Пример #9
0
        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.AreEqual(firstLyric.TimeTags, TestCaseTagHelper.ParseTimeTags(firstTimeTags));
            TimeTagAssert.AreEqual(secondLyric.TimeTags, TestCaseTagHelper.ParseTimeTags(secondTimeTags));
        }