示例#1
0
                  new[] { "[1000,3000]", "[6000,8000]", "[4000,12000]" })] // todo : second lyric start time should be 6000 but can be ignored now.
        public void TestApplyLayoutTime(string[] lyricTexts, string[] actualTimes)
        {
            var lyrics = TestCaseTagHelper.ParseLyrics(lyricTexts);

            var generator = new LayoutGenerator(generatorConfig());

            generator.ApplyLayout(lyrics);

            Assert.AreEqual(lyrics.Select(x => $"[{x.StartTime},{x.EndTime}]").ToArray(), actualTimes);
        }
示例#2
0
        [TestCase(null, null)]                                     // should not crash in null.
        public void TestApplyLayoutIndex(string[] texts, int[] actualLayoutIds)
        {
            var lyrics = texts?.Select(x => new Lyric {
                Text = x
            }).ToArray();

            var generator = new LayoutGenerator(generatorConfig());

            generator.ApplyLayout(lyrics);

            Assert.AreEqual(lyrics?.Select(x => x.LayoutIndex).ToArray(), actualLayoutIds);
        }