示例#1
0
        public void MatchTopic(string topic, string pattern, bool isMatch)
        {
            var packet = new MessagePacket {
                topic = topic
            };

            Assert.Equal(isMatch, packet.MatchTopic(pattern));
        }
示例#2
0
 public void HandleMessage(string topicPattern, MessagePacket messagePacket, Action <MessagePacket> handler)
 => messagePacket.MatchTopic(topicPattern).IfTrue(() => handler(messagePacket));