Example #1
0
        public RateProviderPerformanceComparisonTests(ITestOutputHelper testOutputHelper)
        {
            _testOutputHelper             = testOutputHelper;
            _optimizedRateProviderService = new OptimizedRateProviderService(new RateConfigurationSettings());
            _rateProviderService          = new RateProviderService(new RateConfigurationSettings());

            SetUpRates(_optimizedRateProviderService);
            SetUpRates(_rateProviderService);
        }
Example #2
0
        public static void AddSpaceSaviorServices(this IServiceCollection serviceCollection, IRateConfigurationSettings rateConfigurationSettings)
        {
            var  rateProviderService  = new RateProviderService(rateConfigurationSettings);
            bool ratesSuccessfullySet = rateProviderService.SetUpConfiguredDefaultRates();

            if (!ratesSuccessfullySet)
            {
                throw new InvalidOperationException("The default rates JSON file is invalid.");
            }

            serviceCollection.AddSingleton(rateConfigurationSettings);
            serviceCollection.AddSingleton <IRateProviderService>(rateProviderService);
        }