public void Test2() { CLParser parser = new CLParser(); bool success = false; Exception error = null; try { var config = parser.Run <TestRequiredConfig>(GetArgs().ToArray()); success = true; config = parser.Run <TestRequiredConfig>(new string[] { }); } catch (Exception ex) { error = ex; } Assert.IsTrue(success); Assert.IsNotNull(error); }
public void Test1() { CLParser parser = new CLParser(); var config = parser.Run <TestConfig>(GetArgs().ToArray()); Assert.AreEqual("testbbbb", config.Test); Assert.AreEqual(EnumTest.Test3, config.EnumTest); Assert.AreEqual(4444, config.Num); Assert.AreEqual(0, config.Value); }