public void SendAndWaitTest() { var e = new Endpoint(new SimpleIdentity("e1")); var id = new SimpleIdentity("e2"); var msg = new Dictionary<string, object>(); msg.Add("k", "k"); Assert.AreEqual(msg["k"], e.GetEndpoint(id, URI.ToString()).SendAndWait(msg)["k"]); }
public void SendTest() { var e = new Endpoint(new SimpleIdentity("e1")); var id = new SimpleIdentity("e2"); var msg = new Dictionary<string, object>(); msg.Add("k", "k"); var handle = new EventWaitHandle(false, EventResetMode.AutoReset); e.OnAckMessage += (s, ack) => { Assert.AreEqual(msg["k"], ack.Message["k"]); handle.Set(); }; e.GetEndpoint(id, URI.ToString()).Send(msg); Assert.True(handle.WaitOne(100)); }