private static SvmCommandService setUpCommandService() { var someSvmCommand = new SomeSVMCommand(); var someOtherSvmCommand = new SomeSVMCommand(); var anAction = new Action("OMG, MY FIRST ACTION"); var anotherAction = new Action("The not-as-exciting second action..."); var anotherAnotherAction = new Action("getting old..."); var actionList = new List<IAction> { anAction, anotherAction, anotherAnotherAction }; var previouslyAGatCommand = new GatToSvmAdapter( new GatCommand(actionList) ); var previouslyAsvnnCommand = new BastardizedSVNNAdapter(new BastardSvnnCommand()); var svMacroCommand = new SvMacroCommand( new List<ISVMCommand> {someSvmCommand, previouslyAGatCommand, someOtherSvmCommand} ); var commandService = new SvmCommandService(new Dictionary<string, ISVMCommand> { {"cmd1", someSvmCommand}, {"cmd2", someOtherSvmCommand}, {"gatCmd", previouslyAGatCommand}, {"bastardCommand", previouslyAsvnnCommand}, {"macroCommand", svMacroCommand} }); return commandService; }
private static IEnumerable<ISVMCommand> GetListOfCommands(string[] args, SvmCommandService commandService) { var commandList = new List<ISVMCommand>(); for (var i = 1; i < args.Length; i++) { commandList.Add(commandService.GetCommand(args[i])); } return commandList; }