コード例 #1
0
ファイル: TestErrorTracker.cs プロジェクト: mgibas/Rebus
        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);
        }