Exemple #1
0
        [TestCase(new[] { "[1]name:Singer1" }, "[0]name:Singer0", false, null)] // should not remove invalid singer.
        public void TestRemoveSinger(string[] existSingers, string removeSinger, bool isAdded, int[] actualSingers)
        {
            var singer = TestCaseTagHelper.ParseSinger(removeSinger);
            var lyric  = new Lyric
            {
                Singers = TestCaseTagHelper.ParseSingers(existSingers)?.Select(x => x.ID).ToArray()
            };

            try
            {
                Assert.AreEqual(LyricUtils.RemoveSinger(lyric, singer), isAdded);
                Assert.AreEqual(lyric.Singers, actualSingers);
            }
            catch
            {
                Assert.IsNull(actualSingers);
            }
        }