public void GetValue_ReturnsValueIfFound() { ConfigContext sut = new ConfigContext("LevelKey", "LevelValue"); sut.UpsertConfigValue("AKey", "AValue"); Assert.That(sut.GetConfigValue("AKey").Equals("AValue", StringComparison.InvariantCulture)); }
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)); }
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)); }
public void GetValue_ReturnsNullIfNotFound() { ConfigContext sut = new ConfigContext("LevelKey", "LevelValue"); Assert.IsNull(sut.GetConfigValue("MissingKey")); }