public void MatchTopic(string topic, string pattern, bool isMatch) { var packet = new MessagePacket { topic = topic }; Assert.Equal(isMatch, packet.MatchTopic(pattern)); }
public void HandleMessage(string topicPattern, MessagePacket messagePacket, Action <MessagePacket> handler) => messagePacket.MatchTopic(topicPattern).IfTrue(() => handler(messagePacket));