Esempio n. 1
0
        protected override void Given()
        {
            _left = 1;
            _right = 2;

            _outputVariable = new Variable("Grasp", "Output", typeof(int));

            var calculation = new Calculation(_outputVariable, Expression.Add(Expression.Constant(_left), Expression.Constant(_right)));

            var schema = new GraspSchema(Enumerable.Empty<Variable>(), new[] { calculation });

            var executable = schema.Compile();

            _runtime = executable.GetRuntime(A.Fake<IRuntimeSnapshot>());
        }
Esempio n. 2
0
        protected override void Given()
        {
            _left1 = 1;
            _right1 = 2;

            _left2 = 10;

            _outputVariable1 = new Variable("Grasp", "Output1", typeof(int));
            _outputVariable2 = new Variable("Grasp", "Output2", typeof(int));

            var calculation1 = new Calculation(_outputVariable1, Expression.Add(Expression.Constant(_left1), Expression.Constant(_right1)));
            var calculation2 = new Calculation(_outputVariable2, Expression.Add(Expression.Constant(_left2), Variable.Expression(_outputVariable1)));

            var schema = new GraspSchema(Enumerable.Empty<Variable>(), new[] { calculation1, calculation2 });

            var executable = schema.Compile();

            _runtime = executable.GetRuntime(A.Fake<IRuntimeSnapshot>());
        }
        protected override void Given()
        {
            _leftValue = 1;
            _right = 2;

            var left = new Variable("Grasp", "Left", typeof(int));

            _outputVariable = new Variable("Grasp", "Output", typeof(int));

            var calculation = new Calculation(_outputVariable, Expression.Add(Variable.Expression(left), Expression.Constant(_right)));

            var schema = new GraspSchema(new[] { left }, new[] { calculation });

            var executable = schema.Compile();

            var initialState = A.Fake<IRuntimeSnapshot>();

            A.CallTo(() => initialState.GetValue(left)).Returns(_leftValue);

            _runtime = executable.GetRuntime(initialState);
        }