public void UserCanSetACostantValueViaString() { //Arrange string input = "a=15"; Parse parse = new Parse(); var constants = new Constants(); char key = parse.ExtractConstant(input); int value = parse.ExtractValue(input); var splitInput = input.Split('='); //ACT constants.setConstant(key, value); //Assert Assert.IsTrue(constants.calculatorConstants.ContainsKey(key)); Assert.IsTrue(constants.calculatorConstants.ContainsValue(value)); }
public void UserCanGetACostantValueViaString() { //Arrange string input = "a=15"; Parse parse = new Parse(); var constants = new Constants(); Char key = parse.ExtractConstant(input); int value = parse.ExtractConstant(input); var splitInput = input.Split('='); constants.setConstant(key, value); //ACT int valueExtracted = constants.getConstant(key); //Assert Assert.AreEqual(value, valueExtracted); }