예제 #1
0
 public SubscriptionManagerTest()
 {
     peer    = new Core.InMemoryPeer();
     manager = new SubscriptionManager();
     manager.Subscribe(peer, "foo");
     peer.MessageReceived += ((x, y) => { if (x == "foo")
                                          {
                                              messageReceived = true;
                                          }
                              });
 }
예제 #2
0
        public void WildCard_NeedsFullTextAheadOfWildCard()
        {
            peer    = new Core.InMemoryPeer();
            manager = new SubscriptionManager();
            bool messageReceived = false;

            manager.Subscribe(peer, "foo/*");
            peer.MessageReceived += ((x, y) => { if (x == "fo/fno")
                                                 {
                                                     messageReceived = true;
                                                 }
                                     });

            manager.DispatchMessage("fo/fno", new byte[] { 0x01 }, Core.QoS.BestEffort);

            Assert.False(messageReceived);
        }