示例#1
0
        public void Call_input_port()
        {
            var ebc        = new Simple_EBC(0);
            var inputPorts = Find_input_ports(ebc);

            Call_input_port_method(ebc, inputPorts, "InPort2", null);
            Assert.AreEqual("x", ebc.noPortField);

            Call_input_port_method(ebc, inputPorts, "InPort1", "42");
            Assert.AreEqual("42", ebc.noPortField);
        }
示例#2
0
        public void Continue_from_events()
        {
            var ebc         = new Simple_EBC(0);
            var outputPorts = Find_output_ports(ebc);

            var outputMessages = new List <IMessage>();

            Assign_handlers_to_output_port_events(ebc, outputPorts, outputMessages.Add);

            ebc.InPort1("hello");

            Assert.AreEqual("ebc.OutPort1", outputMessages[0].Port.Fullname);
            Assert.AreEqual("ebc.OutPort2", outputMessages[1].Port.Fullname);
            Assert.AreEqual("hello", (string)outputMessages[1].Data);
        }