public static void Print(TestParams tp) { Console.WriteLine(string.Format("{0}Test run #{1} [{2}]:", (runCnt > 0 ? Environment.NewLine : string.Empty), ++runCnt, tp.PrintLists())); var result = ListSlicer.Slice(tp.OriginalList, tp.RequestedLists); int listCnt = 0; foreach (List <int> l in result) { Console.WriteLine(string.Format("List# {0}:", ++listCnt)); foreach (int item in l) { Console.WriteLine(item); } } }
static void Main(string[] args) { ListSlicer.Print(new TestParams(new List <int>() { 1, 2, 3, 4, 5, 6, 7, 8 }, new List <int>() { 2, 3, 1 })); ListSlicer.Print(new TestParams(new List <int>(), new List <int>() { 2, 3, 1 })); ListSlicer.Print(new TestParams(new List <int>() { 1, 2, 3 }, new List <int>() { 2, 3, 1 })); }