コード例 #1
0
        public void MessageValidatorFormatsMessageIdBeforeCaching() {
            var messageValidator = new MessageValidator();
            var messageId = Guid.NewGuid().ToString();

            messageValidator.AddMessageIdToCache(messageId);
            Assert.IsTrue(!messageValidator.Cache.First().Contains("-"));
        }
コード例 #2
0
        public void MessageValidatorIdentifiesDuplicateMessage() {
            var messageValidator = new MessageValidator();
            const string messageId = "5439c23e59b84786ae9395ca04d826b9";

            messageValidator.AddMessageIdToCache(messageId);
            for (var i = 0; i < 100; i++) {
                messageValidator.AddMessageIdToCache(Guid.NewGuid().ToString("N"));
            }

            Assert.IsTrue(messageValidator.ValidateMessageId(messageId));
        }
コード例 #3
0
 protected ServiceBus(TServiceBusAdapter serviceBusAdapter, MessageValidator messageValidator)
 {
     this.serviceBusAdapter = serviceBusAdapter;
     this.messageValidator  = messageValidator;
 }