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

            Assert.Throws<NotSupportedException>(() => add.Execute(parameters));
        }
Exemple #2
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.Execute(parameters);
            var expected = 8.0;

            Assert.Equal(expected, result);
            Assert.Equal(expected, parameters["x"]);
        }