Beispiel #1
0
        public void BoolMulNumberTest()
        {
            var parameters = new ParameterCollection() { new Parameter("x", true) };
            var add = new MulAssign(new Variable("x"), new Number(2));

            Assert.Throws<NotSupportedException>(() => add.Execute(parameters));
        }
Beispiel #2
0
        public void MulAssignCalc()
        {
            var parameters = new ParameterCollection() { new Parameter("x", 10) };
            var mul = new MulAssign(new Variable("x"), new Number(2));
            var result = mul.Execute(parameters);
            var expected = 20.0;

            Assert.Equal(expected, result);
            Assert.Equal(expected, parameters["x"]);
        }
Beispiel #3
0
 public void NumberMulBoolTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", 2) };
     var add = new MulAssign(new Variable("x"), new Bool(true));
     add.Calculate(parameters);
 }
Beispiel #4
0
 public void BoolMulNumberTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", true) };
     var add = new MulAssign(new Variable("x"), new Number(2));
     add.Calculate(parameters);
 }