public void SubAssignCalc() { var parameters = new ParameterCollection() { new Parameter("x", 10) }; var sub = new SubAssign(new Variable("x"), new Number(2)); var result = sub.Calculate(parameters); var expected = 8.0; Assert.AreEqual(expected, result); Assert.AreEqual(expected, parameters["x"]); }
public void NumberSubBoolTest() { var parameters = new ParameterCollection() { new Parameter("x", 2) }; var add = new SubAssign(new Variable("x"), new Bool(true)); add.Calculate(parameters); }
public void BoolSubNumberTest() { var parameters = new ParameterCollection() { new Parameter("x", true) }; var add = new SubAssign(new Variable("x"), new Number(2)); add.Calculate(parameters); }