Beispiel #1
0
        public void GetRulesList_ReturnsRulesList()
        {
            var dataStore = RCTestUtils.GetDataStore();
            RemoteConfigDataManager dataManager = new RemoteConfigDataManager();

            dataManager.SetRulesDataStore(new List <Rule>(RCTestUtils.rulesList));

            Assert.That(Equals(dataManager.GetRulesList(), dataStore.rulesList));
        }
Beispiel #2
0
        public void SetRulesDataStore_SetsEntityIdOnKeys()
        {
            var dataStore = RCTestUtils.GetDataStore();
            RemoteConfigDataManager dataManager = new RemoteConfigDataManager();

            dataManager.SetRulesDataStore(new List <Rule>(RCTestUtils.rulesList));

            var rulesList = dataManager.GetRulesList();

            foreach (var rule in rulesList)
            {
                foreach (var setting in rule.value)
                {
                    Assert.That(RCTestUtils.rsDictWithMetadata.TryGetValue(setting.metadata.entityId, out RsKvtData rsKvt));
                }
            }

            Assert.That(Equals(dataManager.GetRulesList(), dataStore.rulesList));
        }
Beispiel #3
0
        public void ValidateRule_ShouldReturnTrueForAddingDuplicateRuleName()
        {
            RemoteConfigDataManager dataManager = new RemoteConfigDataManager();
            var rule = RCTestUtils.CreateValidRule();

            dataManager.UpdateRule(rule);
            var ruleDuplicate = RCTestUtils.CreateValidRule();

            dataManager.UpdateRule(ruleDuplicate);
            var rulesList = dataManager.GetRulesList();

            Assert.That(rulesList[0].name != rulesList[1].name);
        }