/// <summary> /// Constructor /// </summary> /// <param name="config">Config to be updated with new server information</param> /// <param name="name">Name of server configuration for easier referencing</param> /// <param name="host">IP or hostname of server</param> /// <param name="port">Port where the logio server is receiving commands</param> public AddServerCommand(LogioConfig config, string name, string host, int port) { Config = config; Name = name; Host = host; Port = port; }
private LogioConfig GetTestConfig() { var config = new LogioConfig(new MemoryStream()); config.AddServer("server1"); config.AddServerParam("server1", "host", "123.456.789.0"); config.AddServerParam("server1", "port", "27888"); config.AddServer("server2"); config.AddServerParam("server2", "host", "123.456.789.1"); config.AddServerParam("server2", "port", "27888"); config.SetDefaultServer("server1"); return(config); }
public void CommandMessage(string args, Type commandType, string message) { LogioConfig config = GetTestConfig(); LogioTestClient client = new LogioTestClient(); var parser = new CommandLineArgParser(() => config, x => client); var command = parser.Parse(Helper.CommandLineToArgs(args)); Assert.NotNull(command); Assert.IsType(commandType, command); command.Execute(); Assert.Equal(message, client.Message); }
public UseServerCommand(LogioConfig config, string name) { Config = config; Name = name; }
public ListServerCommand(LogioConfig config) { Config = config; }