本文整理汇总了C#中Config.ForEnvironment方法的典型用法代码示例。如果您正苦于以下问题:C# Config.ForEnvironment方法的具体用法?C# Config.ForEnvironment怎么用?C# Config.ForEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.ForEnvironment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_all_environment_is_not_case_sensitive
public void test_all_environment_is_not_case_sensitive()
{
var upperCaseAllConfig = new Config(@"{""Prod"": {""Shared"": ""production!""}, ""All"": {""Shared"": ""none"", ""AllOnly"": ""works""}}");
var upperCaseAllEnvironmentConfig = upperCaseAllConfig.ForEnvironment("Prod");
Assert.That(upperCaseAllEnvironmentConfig.AllOnly, Is.EqualTo("works"));
var lowerCaseAllConfig = new Config(@"{""Prod"": {""Shared"": ""production!""}, ""all"": {""Shared"": ""none"", ""AllOnly"": ""works""}}");
var lowerCaseAllEnvironmentConfig = lowerCaseAllConfig.ForEnvironment("Prod");
Assert.That(lowerCaseAllEnvironmentConfig.AllOnly, Is.EqualTo("works"));
}
示例2: test_environment_specific_config_overrides_all
public void test_environment_specific_config_overrides_all()
{
var config = new Config(@"{""Prod"": {""Shared"": ""production!""}, ""All"": {""Shared"": ""none""}}");
dynamic environmentConfig = config.ForEnvironment("Prod");
Assert.That(environmentConfig.Shared, Is.EqualTo("production!"));
}
示例3: test_environment_property_is_included
public void test_environment_property_is_included()
{
var config = new Config(JsonConfig);
dynamic environmentConfig = config.ForEnvironment("theEnvironment");
Assert.That(environmentConfig.environment, Is.EqualTo("theEnvironment"));
}
示例4: test_environment_specific_config_is_included
public void test_environment_specific_config_is_included()
{
var config = new Config(JsonConfig);
dynamic environmentConfig = config.ForEnvironment("theEnvironment");
Assert.That(environmentConfig.TheKey, Is.EqualTo("TheValue"));
}
示例5: test_environment_specific_config_no_environment_property_if_has_environment_config_json
public void test_environment_specific_config_no_environment_property_if_has_environment_config_json()
{
var config = new Config(@"{""Prod"": {""Environment"": ""production!""}, ""All"": {""Shared"": ""none""}}");
dynamic environmentConfig = config.ForEnvironment("Prod");
var env = environmentConfig.environment;
Assert.That(environmentConfig.environment, Is.EqualTo("production!"));
}