public void ArgActionInvokeThrowsOnNullAction()
{
var args = new string[] { };
var argAction = new ArgAction<ActionTestArgs>();
// Not setting .ActionArgs or .Args to leave them as null.
try
{
argAction.Invoke();
Assert.Fail("Should have thrown an exception.");
}
catch (Exception ex)
{
Assert.IsInstanceOfType(ex, typeof(MissingArgException));
Assert.AreEqual("No action was specified", ex.Message);
}
}