File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
tests/Tests.FeatureManagement Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,20 @@ public async Task MergesFeatureFlagsFromDifferentConfigurationSources()
584584 Assert . True ( await featureManager8 . IsEnabledAsync ( "FeatureC" ) ) ;
585585 Assert . False ( await featureManager8 . IsEnabledAsync ( "Feature1" ) ) ;
586586 Assert . False ( await featureManager8 . IsEnabledAsync ( "Feature2" ) ) ;
587+
588+ var configurationManager = new ConfigurationManager ( ) ;
589+ configurationManager
590+ . AddJsonFile ( "appsettings1.json" )
591+ . AddJsonFile ( "appsettings2.json" ) ;
592+
593+ var services = new ServiceCollection ( ) ;
594+ services . AddFeatureManagement ( ) ;
595+
596+ var featureManager9 = new FeatureManager ( new ConfigurationFeatureDefinitionProvider ( configurationManager , mergeOptions ) ) ;
597+ Assert . True ( await featureManager9 . IsEnabledAsync ( "FeatureA" ) ) ;
598+ Assert . True ( await featureManager9 . IsEnabledAsync ( "FeatureB" ) ) ;
599+ Assert . True ( await featureManager9 . IsEnabledAsync ( "Feature1" ) ) ;
600+ Assert . False ( await featureManager9 . IsEnabledAsync ( "Feature2" ) ) ; // appsettings2 should override appsettings1
587601 }
588602 }
589603
You can’t perform that action at this time.
0 commit comments