Esempio n. 1
0
        public void UpdateSettingForRule_ShouldUpdateSettingOnRightRule()
        {
            var dataStore = RCTestUtils.GetDataStore();

            dataStore.rulesList = new List <RuleWithSettingsMetadata>(RCTestUtils.rulesWithSettingsMetadata);
            dataStore.rsKeyList = new List <RsKvtData>(RCTestUtils.rsListWithMetadata);
            RemoteConfigDataManager dataManager = new RemoteConfigDataManager();
            var newVal = "new value";

            dataManager.UpdateSettingForRule(RCTestUtils.ruleOneId, new RsKvtData(RCTestUtils.stringKeyEntityId, new RemoteSettingsKeyValueType(RCTestUtils.stringKeyName, "string", newVal)));
            var setting = dataStore.rulesList.Find(r => r.id == RCTestUtils.ruleOneId).value.Find((obj) => obj.metadata.entityId == RCTestUtils.stringKeyEntityId);

            Assert.That(string.Equals(setting.rs.value, newVal));
            Assert.That(dataStore.updatedRulesIDs.Contains(RCTestUtils.ruleOneId));
        }