public void Get_WithVariable_ReturnsMatchingEnvironmentVariable()
        {
            var previous = Environment.GetEnvironmentVariable("AN_ENV_VAR");

            Environment.SetEnvironmentVariable("AN_ENV_VAR", "test");

            _env.Get("AN_ENV_VAR").Should().Be("test");

            Environment.SetEnvironmentVariable("AN_ENV_VAR", previous);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get the env entry associated with the name.
 /// </summary>
 /// <param name="envName"></param>
 /// <returns></returns>
 public static EnvItem Get(string envName)
 {
     return(_provider.Get(envName));
 }
 private void PopulateApiKey(Client client)
 {
     client.ApiKey = _env.Get($"{client.ApiKeyPrefix}_API_KEY");
 }