public TestableProcessCommand(IContainer container, IProcessIO io, IRemoteCommandArgs args, string workingDirectory, string exePath, params string[] exeArgs) { this.Container = container; this.IO = io; this.CommandArgs = args; this.workingDirectory = workingDirectory; this.exePath = exePath; this.exeArguments = exeArgs; }
public static RemoteCommand Create(IContainer container, IProcessIO io, string commandType, IRemoteCommandArgs args) { RemoteCommand command = null; switch (commandType.ToLowerInvariant()) { case "mkdir": command = new MkDirCommand(); break; case "touch": command = new TouchCommand(); break; case "exe": command = new ExeCommand(); break; case "ps1": command = new PowerShellCommand(); break; case "unzip": command = new UnzipCommand(); break; case "tar": command = new TarCommand(); break; case "replace-tokens": command = new ReplaceTokensCommand(); break; default: throw new NotImplementedException(string.Format("Command type {0} is unknown.", commandType)); } command.Container = container; command.IO = io; command.CommandArgs = args; return(command); }