Exemple #1
0
        public void DecBoolTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", true)
            };
            var dec = new Dec(Variable.X);

            Assert.Throws <NotSupportedException>(() => dec.Execute(parameters));
        }
Exemple #2
0
        public void DecCalcTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 10)
            };
            var dec    = new Dec(Variable.X);
            var result = (double)dec.Execute(parameters);

            Assert.Equal(9.0, result);
            Assert.Equal(9.0, parameters["x"]);
        }
Exemple #3
0
        public void NotVarTest()
        {
            var dec = new Dec(new Number(2));

            Assert.Equal(1.0, dec.Execute());
        }