Пример #1
0
        public void GetValue_ReturnsValueIfFound()
        {
            ConfigContext sut = new ConfigContext("LevelKey", "LevelValue");

            sut.UpsertConfigValue("AKey", "AValue");
            Assert.That(sut.GetConfigValue("AKey").Equals("AValue", StringComparison.InvariantCulture));
        }
Пример #2
0
        public void UpsertingExistingNameAndValue_CausesValueToBeStored()
        {
            ConfigContext sut = new ConfigContext("LevelKey", "LevelValue");

            sut.UpsertConfigValue("AConfigKey", "AConfigValue");
            sut.UpsertConfigValue("AConfigKey", "ANewConfigValue");
            Assert.That(sut.GetConfigValue("AConfigKey").Equals("ANewConfigValue", StringComparison.InvariantCulture));
        }
Пример #3
0
        public void GetValue_ReturnsCorrectValueWhenMultiopleEntries()
        {
            ConfigContext sut = new ConfigContext("LevelKey", "LevelValue");

            sut.UpsertConfigValue("AKey1", "AValue1");
            sut.UpsertConfigValue("AKey2", "AValue2");
            sut.UpsertConfigValue("AKey3", "AValue3");
            sut.UpsertConfigValue("AKey4", "AValue4");
            sut.UpsertConfigValue("AKey5", "AValue5");
            sut.UpsertConfigValue("AKey6", "AValue6");
            sut.UpsertConfigValue("AKey7", "AValue7");
            sut.UpsertConfigValue("AKey8", "AValue8");
            sut.UpsertConfigValue("AKey9", "AValue9");
            sut.UpsertConfigValue("AKey10", "AValue10");
            sut.UpsertConfigValue("AKey11", "AValue11");
            Assert.That(sut.GetConfigValue("AKey6").Equals("AValue6", StringComparison.InvariantCulture));
        }
Пример #4
0
        public void GetValue_ReturnsNullIfNotFound()
        {
            ConfigContext sut = new ConfigContext("LevelKey", "LevelValue");

            Assert.IsNull(sut.GetConfigValue("MissingKey"));
        }