public EnvEndpoint(IEnvOptions options, IConfiguration configuration, IHostingEnvironment env, ILogger <EnvEndpoint> logger = null)
     : base(options)
 {
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _env           = env ?? throw new ArgumentNullException(nameof(env));
     _logger        = logger;
 }
Ejemplo n.º 2
0
        public void Constructor_ThrowsIfNulls()
        {
            IEnvOptions         options       = null;
            IConfiguration      configuration = null;
            IHostingEnvironment env           = null;

            Assert.Throws <ArgumentNullException>(() => new EnvEndpoint(options, configuration, env));

            options = new EnvEndpointOptions();
            Assert.Throws <ArgumentNullException>(() => new EnvEndpoint(options, configuration, env));

            configuration = new ConfigurationBuilder().Build();
            Assert.Throws <ArgumentNullException>(() => new EnvEndpoint(options, configuration, env));
        }
Ejemplo n.º 3
0
 public EnvEndpoint(IEnvOptions options, IConfiguration configuration, IHostEnvironment env, ILogger <EnvEndpoint> logger = null)