示例#1
0
        public void BoolDivNumberTest()
        {
            var parameters = new ParameterCollection() { new Parameter("x", true) };
            var add = new DivAssign(new Variable("x"), new Number(2));

            Assert.Throws<NotSupportedException>(() => add.Execute(parameters));
        }
示例#2
0
        public void DivAssignCalc()
        {
            var parameters = new ParameterCollection() { new Parameter("x", 10) };
            var div = new DivAssign(new Variable("x"), new Number(2));
            var result = div.Execute(parameters);
            var expected = 5.0;

            Assert.Equal(expected, result);
            Assert.Equal(expected, parameters["x"]);
        }
示例#3
0
 public void NumberDivBoolTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", 2) };
     var add = new DivAssign(new Variable("x"), new Bool(true));
     add.Calculate(parameters);
 }
示例#4
0
 public void BoolDivNumberTest()
 {
     var parameters = new ParameterCollection() { new Parameter("x", true) };
     var add = new DivAssign(new Variable("x"), new Number(2));
     add.Calculate(parameters);
 }