public void Process_DoesNotProcessDeliveryIfItDoesntExist() { var message = new Message(); message.InitializePrivateProperty("Delivery"); ListenerLink link = Construct.Uninitialized <ListenerLink>(); MessageContext messageContext = Construct.ForPrivate <MessageContext>(link, message); var queue = new DeliveryQueue(); Should.NotThrow(() => queue.Process(messageContext)); }
public void Dispose_DisposesQueue() { var delivery = new Delivery(new Message()); var queue = new DeliveryQueue(); queue.Dispose(); Should.Throw <ObjectDisposedException>(() => queue.Enqueue(delivery)); Should.Throw <ObjectDisposedException>(() => queue.Dequeue(CancellationToken.None)); Should.Throw <ObjectDisposedException>(() => queue.Process(null)); }
public void Process_ProcessesDelivery() { var message = new Message(); message.InitializePrivateProperty("Delivery"); ListenerLink link = Construct.Uninitialized <ListenerLink>(); MessageContext messageContext = Construct.ForPrivate <MessageContext>(link, message); var delivery = new Delivery(message); var queue = new DeliveryQueue(); queue.Enqueue(delivery); queue.Dequeue(CancellationToken.None); queue.Process(messageContext); delivery.Processed.ShouldNotBeNull(); }