public void Execute(string[] args)
        {
            var command = args.FirstOrDefault();

            if (string.IsNullOrEmpty(command))
            {
                _outputWriter.WriteError("Command required");
                return;
            }

            if (CoffeeCommands.ContainsKey(command))
            {
                CoffeeCommands[command]?.Execute(args.Skip(1).Take(args.Length - 1).ToArray());
                return;
            }

            _outputWriter.WriteError($"No command found: {command}");
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     _coffeeCommands = new CoffeeCommands(_coffeeRepository.Object, _userRepository.Object, _slack.Object, _adminValidator.Object, _coffeeBreakService.Object);
 }
Ejemplo n.º 3
0
 public void Setup()
 {
     _adminValidator.Setup(admin => admin.IsUserSlackAdmin(User)).Returns(Task.FromResult(true));
     _coffeeCommands = new CoffeeCommands(_coffeeRepository.Object, _userRepository.Object, _slack.Object, _adminValidator.Object, _coffeeBreakService.Object, _userService.Object);
 }