Ejemplo n.º 1
0
        public SendResponse Send(string message)
        {
            try
            {
                int price = _cost.CalculatePrice(message);
                _sender.Send(message);

                return(new SendResponse()
                {
                    Message = message,
                    Price = price,
                    ResultMessage = "Success"
                });
            }
            catch (Exception ex)
            {
                _logger.Error($"There was an error: {ex.Message}");

                return(new SendResponse()
                {
                    Message = string.Empty,
                    Price = 0,
                    ResultMessage = "Fail"
                });
            }
        }