public void MessageValidatorFormatsMessageIdBeforeCaching() { var messageValidator = new MessageValidator(); var messageId = Guid.NewGuid().ToString(); messageValidator.AddMessageIdToCache(messageId); Assert.IsTrue(!messageValidator.Cache.First().Contains("-")); }
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)); }
protected ServiceBus(TServiceBusAdapter serviceBusAdapter, MessageValidator messageValidator) { this.serviceBusAdapter = serviceBusAdapter; this.messageValidator = messageValidator; }