Example #1
0
        public void WithSendFailure_ThenBookmarkIsNotChanged()
        {
            GivenLogFilesInDirectory(files: 2);
            var allFiles    = LogFiles.ToArray();
            var initialFile = LogFiles[0];

            GivenPersistedBookmark(initialFile, 0);
            GivenLogReader(initialFile, length: BatchPostingLimit, maxStreams: BatchPostingLimit);
            GivenSendIsFailed();

            WhenLogShipperIsCalled();

            LogFiles.ShouldBe(allFiles, "Nothing shall be deleted.");

            this.ShouldSatisfyAllConditions(
                () => CurrentLogFileName.ShouldBe(initialFile),
                () => CurrentLogFilePosition.ShouldBe(0),
                () => SentBatches.ShouldBe(0),
                () => SentRecords.ShouldBe(0),
                () => FailedBatches.ShouldBe(1),
                () => FailedRecords.ShouldBe(BatchPostingLimit)
                );
        }