Exemple #1
0
        public void UpdateSetting_UpdatesCorrectSetting()
        {
            var dataStore = RCTestUtils.GetDataStore();

            dataStore.rsKeyList = new List <RsKvtData>(RCTestUtils.rsListWithMetadata);
            RemoteConfigDataManager dataManager = new RemoteConfigDataManager();
            var newRs = new RsKvtData(RCTestUtils.rsListWithMetadata[0].metadata.entityId, new RemoteSettingsKeyValueType("updated-key", "updated-type", "updated-value"));

            dataManager.UpdateSetting(RCTestUtils.rsListWithMetadata[0], newRs);
            Assert.That(!dataStore.rsKeyList.Contains(RCTestUtils.rsListWithMetadata[0]));
            Assert.That(dataStore.rsKeyList.Contains(newRs));
            var rs = dataStore.rsKeyList.Find(s => s.metadata.entityId == newRs.metadata.entityId);

            Assert.That(string.Equals(rs.rs.key, newRs.rs.key));
            Assert.That(string.Equals(rs.rs.type, newRs.rs.type));
            Assert.That(string.Equals(rs.rs.value, newRs.rs.value));
        }