void TestMe(TestMeGen <DateTime> g, string[] args, bool mustThrow) { try { var z = g.TPTest <string, string>(args, "d", 10); foreach (var i in z.Result) { Console.WriteLine("Result = {0}", i); } if (mustThrow) { throw new Exception("failed to throw"); } } catch (AggregateException ae) { if (ae.Flatten().InnerException is ArgumentException) { if (!mustThrow) { throw; } } else { throw; } } }