예제 #1
0
        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"]);
        }
예제 #2
0
 public void NumberSubBoolTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", 2) };
     var add = new SubAssign(new Variable("x"), new Bool(true));
     add.Calculate(parameters);
 }
예제 #3
0
 public void BoolSubNumberTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", true) };
     var add = new SubAssign(new Variable("x"), new Number(2));
     add.Calculate(parameters);
 }