Beispiel #1
0
        public void Resolve_WithNullOrEmptyNameParameter_ReturnsNull()
        {
            var configuration = new ConfigurationBuilder().Build();
            var resolver      = new DefaultNameResolver(configuration);

            // Assert we null returns null
            string result = resolver.Resolve(null);

            Assert.Null(result);

            // Assert empty returns null
            result = resolver.Resolve(string.Empty);
            Assert.Null(result);
        }
Beispiel #2
0
        public ErrorNotifier(SendGridConfiguration sendGridConfig)
        {
            if (sendGridConfig == null)
            {
                throw new ArgumentNullException(nameof(sendGridConfig));
            }
            _sendGridConfig = sendGridConfig;
            _sendGrid       = new SendGridClient(sendGridConfig.ApiKey);

            // pull our IFTTT notification URL from app settings (since it contains a secret key)
            var nameResolver = new DefaultNameResolver();

            _webNotificationUri = nameResolver.Resolve(NotificationUriSettingName);
        }
Beispiel #3
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        public SendGridConfiguration()
        {
            var nameResolver = new DefaultNameResolver();

            ApiKey = nameResolver.Resolve(AzureWebJobsSendGridApiKeyName);
        }