public void Active_EBC_fires_in_flow() { var ebc = new ActiveEbc(); var config = new FlowRuntimeConfiguration() .AddStreamsFrom(@" / .in, subflow.in subflow.out, .out subflow .in, ebc.Run ebc.Out, .out ") .AddEventBasedComponent("ebc", ebc); using (var fr = new FlowRuntime(config)) { fr.Process(".in", "hello"); var result = ""; Assert.IsTrue(fr.WaitForResult(2000, _ => result = (string)_.Data)); Assert.AreEqual("hellox", result); } }
public void Active_EBC_fires_independently() { var ebc = new ActiveEbc(); var config = new FlowRuntimeConfiguration() .AddStreamsFrom(@" / ebc.Out, .out ") .AddEventBasedComponent("ebc", ebc); using(var fr = new FlowRuntime(config)) { ebc.Run("hello"); var result = ""; Assert.IsTrue(fr.WaitForResult(1000, _ => result = (string) _.Data)); Assert.AreEqual("hellox", result); } }
public void Active_EBC_fires_independently() { var ebc = new ActiveEbc(); var config = new FlowRuntimeConfiguration() .AddStreamsFrom(@" / ebc.Out, .out ") .AddEventBasedComponent("ebc", ebc); using (var fr = new FlowRuntime(config)) { ebc.Run("hello"); var result = ""; Assert.IsTrue(fr.WaitForResult(1000, _ => result = (string)_.Data)); Assert.AreEqual("hellox", result); } }
public void An_active_ebc_fires_an_event_before_another_ebc_receives() { var ebc1 = new ActiveEbc(); var config = new FlowRuntimeConfiguration() .AddStreamsFrom(@" / ebc1.Out, ebc2.Run ebc2.Out, .out ") .AddEventBasedComponent("ebc1", ebc1) .AddEventBasedComponent("ebc2", new ActiveEbc()); using (var fr = new FlowRuntime(config)) { ebc1.Run("hello"); var result = ""; Assert.IsTrue(fr.WaitForResult(2000, _ => result = (string)_.Data)); Assert.AreEqual("helloxx", result); } }