/// <summary> /// Remove '-',whitespace and change '?' alias to its internal real option name 'help' /// </summary> /// <returns></returns> internal static bool Test2() { CommandLineValidator cmdValidator = new CommandLineValidator(); string[] args = new string[] { " -? " }; cmdValidator.ValidateCommandLineArguments(ref args); if (args[0] == "help") { return(true); } else { return(false); } }
/// <summary> /// Try to set /unregfile with invalid arguments /// </summary> /// <returns></returns> internal static bool Test4() { CommandLineValidator cmdValidator = new CommandLineValidator(); string[] args = new string[] { "C:\\MyFile.dll", "/unregfile:C:\\MyFile.reg" }; try { cmdValidator.ValidateCommandLineArguments(ref args); return(false); } catch (RegAddinException) { return(true); } catch (Exception) { throw; } }
/// <summary> /// Try to give an unkown option /// </summary> /// <returns></returns> internal static bool Test1() { CommandLineValidator cmdValidator = new CommandLineValidator(); string[] args = new string[] { " /foo " }; try { cmdValidator.ValidateCommandLineArguments(ref args); return(false); } catch (RegAddinException) { return(true); } catch (Exception) { throw; } }