private void TestArgsMappedAuto(IEnumerable <ArgumentMap> maps, string input, bool enablePositionedArgs, string testMethodName) { string testContext = null; var args = ConsoleAppHelper.CommandLineToArgs(input); var argsRaw = CommandParserUtils.ParseArgumentsRaw(args); var argsMappeds = CommandParserUtils.GetArgumentsParsed(argsRaw, enablePositionedArgs, maps.ToArray()); var objectTest = new { input, maps, argsMappeds }; var jsonSerializeConfig = TestHelper.GetJsonConfig(); Assert.True(TestHelper.CompareObjects <TestArgumentMapped>(objectTest, testContext, testMethodName, jsonSerializeConfig)); }
private void TestActionParsed(IEnumerable <ActionMap> actionMaps, string input, bool enableMultiAction, string testMethodName) { // get raw string testContext = null; string[] args; if (!string.IsNullOrWhiteSpace(input)) { args = ConsoleAppHelper.CommandLineToArgs(input); } else { args = new string[0]; } var argsRaw = CommandParserUtils.ParseArgumentsRaw(args, actionMaps); IEnumerable <ArgumentRaw> initialExtraArguments; var actionsMapped = CommandParserUtils.GetActionsParsed(argsRaw, enableMultiAction, actionMaps, out initialExtraArguments); var objectTest = new { input, actionMaps, actionsMapped }; var jsonSerializeConfig = TestHelper.GetJsonConfig(); Assert.True(TestHelper.CompareObjects <TestAction>(objectTest, testContext, testMethodName, jsonSerializeConfig)); }