Ejemplo n.º 1
0
        public void KeepsOnly10MostRecentExceptionDetailsEvenThoughThereMayBeManyMoreFailedDeliveries()
        {
            // arrange
            const string messageId = "bim!";
            errorTracker.MaxRetries = 1000;

            // act
            2000.Times(() => errorTracker.TrackDeliveryFail(messageId, new OmfgExceptionThisIsBad("w00t!")));
            var messageHasFailedMaximumNumberOfTimes = errorTracker.MessageHasFailedMaximumNumberOfTimes(messageId);
            var info = errorTracker.GetPoisonMessageInfo(messageId);

            // assert
            messageHasFailedMaximumNumberOfTimes.ShouldBe(true);
            info.Exceptions.Count().ShouldBe(10);
        }