public void Invoke_when_removing_timeout_fails_should_throw_exception()
        {
            var messageDispatcher = new FakeMessageDispatcher();
            var timeoutPersister = new FakeTimeoutStorage
            {
                OnPeek = (id, bag) => CreateTimeout(),
                OnTryRemove = (id, bag) => false // simulates a concurrent delete
            };

            var behavior = new DispatchTimeoutBehavior(messageDispatcher, timeoutPersister, TransportTransactionMode.TransactionScope);

            Assert.That(async () => await behavior.Invoke(CreateContext(Guid.NewGuid().ToString())), Throws.InstanceOf<Exception>());
        }
Esempio n. 2
0
        public void Invoke_when_removing_timeout_fails_should_throw_exception()
        {
            var messageDispatcher = new FakeMessageDispatcher();
            var timeoutPersister  = new FakeTimeoutStorage
            {
                OnPeek      = (id, bag) => CreateTimeout(),
                OnTryRemove = (id, bag) => false // simulates a concurrent delete
            };

            var behavior = new DispatchTimeoutBehavior(messageDispatcher, timeoutPersister, TransportTransactionMode.TransactionScope);

            Assert.That(async() => await behavior.Invoke(CreateContext(Guid.NewGuid().ToString())), Throws.InstanceOf <Exception>());
        }