public void MathOperation_ShouldCalculateBasicOperations() { var instructions = Common.ParseCode(".rule { property: 1 + 7 * (3 + 5); }"); var expressionExecutor = new ExpressionExecutor(); var ruleset = (RulesetInstruction)instructions.Single(); var property = (PropertyInstruction)ruleset.Instructions.Single(); Assert.Equal(new ScalarPropertyValue(57), expressionExecutor.GetValues(property.Value.Values)); }
public void Setter_ShouldCreatePropertyInstructionWithValueNone() { var instructions = Common.ParseCode(".rule { property: none; }"); var expressionExecutor = new ExpressionExecutor(); var ruleset = (RulesetInstruction)instructions.Single(); var property = (PropertyInstruction)ruleset.Instructions.Single(); Assert.Equal("property", property.Identifier); Assert.Single(property.Value.Values); Assert.Equal(PropertyValue.None, expressionExecutor.GetValues(property.Value.Values)); }