public EmailBuilderTests() { _exception = new Exception("This is an exception!"); _emailConfiguration = new EmailConfiguration { SmtpServer = "http://localhost", SmtpPort = 8080, UseCredentials = false, EnableSsl = true, Sender = new EmailAddress { Address = "*****@*****.**", DisplayName = "Sender" }, Recipients = new List <EmailAddress> { new EmailAddress { Address = "*****@*****.**", DisplayName = "Recipient 1" }, new EmailAddress { Address = "*****@*****.**", DisplayName = "Recipient 2" } } }; _notifierOptions = new NotifierOptions { Environment = "Test", ProjectName = "Fried Chicken" }; }
public ExceptionMessageBuilderTests() { _notifierOptions = new NotifierOptions { ProjectName = "Fried Chicken", Environment = "Development" }; }
public HipchatMessageBuilderTests() { _exception = new Exception("This is an exception!"); _notifierOptions = new NotifierOptions { ProjectName = "Fried Chicken", Environment = "Development" }; }
public FavoriteBasketsWatcherJob(ILogger <FavoriteBasketsWatcherJob> logger, IOptions <NotifierOptions> notifierOptions, ITooGoodToGoService tooGoodToGoService, IEmailService emailService, Context context) { _logger = logger; _notifierOptions = notifierOptions.Value; _tooGoodToGoService = tooGoodToGoService; _emailService = emailService; _context = context; _guid = Guid.NewGuid(); }
public TooGoodToGoNotifierWorker(ILogger <TooGoodToGoNotifierWorker> logger, IHostApplicationLifetime hostApplicationLifetime, IServiceProvider serviceProvider, IOptions <NotifierOptions> notifierOptions, ITooGoodToGoService tooGoodToGoService, Context context) { _logger = logger; _serviceProvider = serviceProvider; _hostApplicationLifetime = hostApplicationLifetime; _notifierOptions = notifierOptions.Value; _tooGoodToGoService = tooGoodToGoService; _context = context; }
public SlackMessageBuilder(SlackConfiguration configuration, Exception exception, NotifierOptions notifierOptions, HttpRequest request) : base(exception, notifierOptions, request) { if (!Uri.IsWellFormedUriString(configuration.WebhookUri, UriKind.Absolute)) { throw new MalformedUriException("SlackMessageBuilder failure: Slack's webhook URI is invalid."); } _configuration = configuration; }
public EmailBuilder(EmailConfiguration configuration, Exception exception, NotifierOptions notifierOptions, HttpRequest request) : base(exception, notifierOptions, request) { if (IsSenderNull(configuration.Sender)) { throw new SenderNullException("EmailBuilder failure: Sender is null."); } if (IsRecipientsCollectionEmpty(configuration.Recipients)) { throw new EmptyRecipientsException("EmailBuilder failure: Recipients collection is empty."); } _configuration = configuration; }
public SlackMessageBuilderTests() { _exception = new Exception("This is an exception!"); _notifierOptions = new NotifierOptions { ProjectName = "Fried Chicken", Environment = "Development" }; _slackConfiguration = new SlackConfiguration { Channel = "the chicken channel", Username = "******", WebhookUri = "http://chicken-channel.slack.com/services/hooks/incomig-webhook?token=123" }; }
public NotifierService(IHubContext <NotificationHub, INotificationHub> hub, IOptionsMonitor <NotifierOptions> options) { _hubContext = hub; _notifierOptions = options.CurrentValue; }
public static IServiceCollection AddNotifier(this IServiceCollection services, NotifierOptions options) { services.AddStackExchangeRedisCache(x => x.Configuration = options.RedisConnectionString); services.AddScoped <INotifierService, NotifierService>(); services.AddSignalR() .AddStackExchangeRedis(options.RedisConnectionString, options => { options.Configuration.ChannelPrefix = "Travely"; }); services.AddHostedService <Worker>(); return(services); }
public HipchatMessageBuilder(Exception exception, NotifierOptions notifierOptions, HttpRequest request) : base(exception, notifierOptions, request) { }