public void ValidateParametersCount(LineExecuting command, int count) { if (command.Parameters.Length != count) { throw new InvalidOperationException("Invalid command"); } }
public void Run() { while (true) { string line = this.reader.ReadLine(); if (string.IsNullOrWhiteSpace(line)) { break; } line = line.Trim(); try { this.inputting = new LineExecuting(line); this.CommandExecuter(); } catch (InvalidOperationException ex) { this.writer.Print(ex.Message); } } }