Exemplo n.º 1
0
 public void Execute(SendReminderRequest sendReminderRequest)
 {
     Called = true;
     CountCalled++;
     Channels.Add(sendReminderRequest.Channel);
     Text = sendReminderRequest.Text;
 }
Exemplo n.º 2
0
        public void Execute(SendReminderRequest sendReminderRequest)
        {
            var result = _slackGateway.Send(new Message
            {
                Channel = sendReminderRequest.Channel,
                Text    = sendReminderRequest.Text
            });

            var address = sendReminderRequest.Email ?? sendReminderRequest.Channel;

            result.OnSuccess(success => Console.WriteLine($"{address} was sent a reminder."));
            result.OnError(error => Console.WriteLine(
                               $"!Failed to send message to {address} with error: {error.Message}"));
        }