Exemplo n.º 1
0
        public void batch_expression(string log1, string log2, int constant)
        {
            var expression = new BatchExpression <int>
            {
                SideExpressions = new IExpression[]
                {
                    new FunctionExpression <LogFunction, Domain.FunctionsDomain.Void>
                    {
                        ArgumentExpressions = new Dictionary <string, IExpression>
                        {
                            [nameof(LogFunction.Log)] = new ConstantExpression <string> {
                                Value = log1
                            }
                        }
                    },
                    new FunctionExpression <LogFunction, Domain.FunctionsDomain.Void>
                    {
                        ArgumentExpressions = new Dictionary <string, IExpression>
                        {
                            [nameof(LogFunction.Log)] = new ConstantExpression <string> {
                                Value = log2
                            }
                        }
                    }
                },
                ResultExpression = new ConstantExpression <int> {
                    Value = constant
                }
            };

            var result = Act(expression);

            result.Should().Be(constant);
            LogStore.GetLog().Should().Equal(log1, log2);
        }
Exemplo n.º 2
0
        public Void Handle(LogFunction function)
        {
            LogStore.Log(function.Log);

            return(Void.Value);
        }