HasVariable() public méthode

public HasVariable ( ) : bool
Résultat bool
Exemple #1
0
        public void SendMessageToProcessWithVariableExpression()
        {
            Context context = new Context();
            Process process = new Process();
            context.SetValue("X", 1);

            SendExpression expr = new SendExpression(new ConstantExpression(process), new VariableExpression(new Variable("X")));

            Assert.IsNotNull(expr.ProcessExpression);
            Assert.IsInstanceOfType(expr.ProcessExpression, typeof(ConstantExpression));
            Assert.IsNotNull(expr.MessageExpression);
            Assert.IsInstanceOfType(expr.MessageExpression, typeof(VariableExpression));

            Assert.IsTrue(expr.HasVariable());
            Assert.AreEqual(1, expr.Evaluate(context));
            Assert.AreEqual(1, process.GetMessage());
        }