Пример #1
0
        public Process_message()
        {
            // Build
            _map = new Map_message_to_input_ports();
            var output = new Output_result();

            _create = new Create_task();
            var wrap = new Wrap_EBC_method();
            var exec = new Execute_task();
            var nest = new Nest_message_flow();

            // Bind
            _process                 += _map.Process;
            _map.Result              += _ => Message(_);
            _map.Result              += output.Process;
            output.Result            += _ => Result(_);
            output.Continue          += _create.Process;
            _create.Result           += wrap.Process;
            _create.UnknownOperation += nest.Process;
            wrap.Result              += exec.Process;
            exec.Result              += _ => Continue(_);
            exec.HandledException    += _ => Continue(_);
            exec.UnhandledException  += _ => UnhandledException(_);
            nest.Result              += _map.Process;

            _execute += exec.Process;
        }
Пример #2
0
        public void Operation_name_without_portname()
        {
            var sut = new Create_task();

            var operations = new Dictionary <string, IOperation>();
            var operation  = new Operation("y", null);

            operations.Add(operation.Name, operation);
            sut.Inject(operations);

            Task result = null;

            sut.Result += _ => result = _;

            var msg = new Message("y", null);

            sut.Process(msg);

            Assert.AreSame(msg, result.Message);
            Assert.AreSame(operation, result.Operation);
        }