Exemplo n.º 1
0
        public void AddAssignCalc()
        {
            var parameters = new ParameterCollection() { new Parameter("x", 10) };
            var add = new AddAssign(new Variable("x"), new Number(2));
            var result = add.Calculate(parameters);
            var expected = 12.0;

            Assert.AreEqual(expected, result);
            Assert.AreEqual(expected, parameters["x"]);
        }
Exemplo n.º 2
0
 public void NumberAddBoolTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", 2) };
     var add = new AddAssign(new Variable("x"), new Bool(true));
     add.Calculate(parameters);
 }
Exemplo n.º 3
0
 public void BoolAddNumberTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", true) };
     var add = new AddAssign(new Variable("x"), new Number(2));
     add.Calculate(parameters);
 }