public void ReplacesSectionPrefix(string appSettingsKey, string appSettingsKeyDelimiter, string appSettingsSectionPrefix, string configurationKey, string value)
			{
				var appSettings = new NameValueCollection { { appSettingsKey, value } };
				var provider = new AppSettingsConfigurationProvider(appSettings, appSettingsKeyDelimiter, appSettingsSectionPrefix);

				provider.Load();

				string configurationValue;
				Assert.True(provider.TryGet(configurationKey, out configurationValue));
				Assert.Equal(value, configurationValue);
			}
コード例 #2
0
ファイル: AccountController.cs プロジェクト: c0d3m0nky/mty
        public AccountController
        (
            IConfigurationProvider configurationProvider,
            IAuthenticationService authenticationService
        )
        {
            // Notes: Should break if passed incorrect type to avoid duck type parameters resolution
            _configurationProvider = configurationProvider as AppSettingsConfigurationProvider;

            _authenticationService = authenticationService;
        }
			public void AddsAppSettings(string appSettingsKey, string configurationKey, string value)
			{
				var appSettings = new NameValueCollection { { appSettingsKey, value } };
				var appSettingsKeyDelimiter = string.Empty;
				var provider = new AppSettingsConfigurationProvider(appSettings, appSettingsKeyDelimiter);

				provider.Load();

				string configurationValue;
				Assert.True(provider.TryGet(configurationKey, out configurationValue));
				Assert.Equal(value, configurationValue);
			}
コード例 #4
0
ファイル: HomeController.cs プロジェクト: c0d3m0nky/mty
        public HomeController
        (
            IConfigurationProvider configurationProvider,
            IRevenueReportService revenueService,
            Logger logger
        )
        {
            // Notes: Should break if passed incorrect type to avoid duck type parameters resolution
            _configurationProvider = configurationProvider as AppSettingsConfigurationProvider;

            _revenueService = revenueService;
            _logger = logger;
        }