[TestCase(new[] { "[1]name:Singer1" }, "[0]name:Singer0", false, null)] // should not add invalid singer. public void TestAddSinger(string[] existSingers, string addSinger, bool isAdded, int[] actualSingers) { var singer = TestCaseTagHelper.ParseSinger(addSinger); var lyric = new Lyric { Singers = TestCaseTagHelper.ParseSingers(existSingers)?.Select(x => x.ID).ToArray() }; try { Assert.AreEqual(LyricUtils.AddSinger(lyric, singer), isAdded); Assert.AreEqual(lyric.Singers, actualSingers); } catch { Assert.IsNull(actualSingers); } }