Пример #1
0
        public void StaticSettingProviderGetVersionedSettingLoadTest()
        {
            var service = new DemonstrationService(new StaticSettingProvider(KeyCount, Guid.NewGuid().ToString()));

            for (var i = 0; i < KeyCount; i++)
            {
                service.GetVersionedSetting(KeyCount);
            }
        }
Пример #2
0
        public void DictionarySettingProviderGetVersionedSettingLoadTest()
        {
            var service = new DemonstrationService(new DictionarySettingProvider());

            for (var i = 0; i < KeyCount; i++)
            {
                service.AddVersionedSetting(Guid.NewGuid().ToString());
                service.GetVersionedSetting(i + 1);
            }
        }
        public void GetVersionedSettingUnitTest()
        {
            const string setting = "TestSetting";
            const int    version = 12345;

            _settingProvider.Expect(sp => sp[Arg <int> .Is.Equal(version)]).Return(setting);

            var service = new DemonstrationService(_settingProvider);
            var result  = service.GetVersionedSetting(version);

            Assert.AreEqual(setting, result);
        }