示例#1
0
        public void HasNextTrueWhenInitialRun()
        {
            StepContext previous = new StepContext();
            StepContext current  = StepContext.InitialRun(previous, chunkSize: 2);

            Assert.That(current.HasNext, Is.True);
        }
示例#2
0
        public void IfPreviousAttemptWasTheFirstAttempThenRetryFirstItem()
        {
            StepContext previous = new StepContext {
                NumberOfItemsProcessed = 0, StepIndex = 0
            };
            StepContext current = StepContext.InitialRun(previous, chunkSize: 2);

            Assert.That(current.StepIndex, Is.EqualTo(0));
        }
示例#3
0
        public void IfPreviousAttemptWasFailureThenRetryDuringRestart()
        {
            StepContext previous = new StepContext {
                NumberOfItemsProcessed = 0, StepIndex = 4
            };

            StepContext current = StepContext.InitialRun(previous, chunkSize: 2);

            Assert.That(current.StepIndex, Is.EqualTo(2));
            Assert.IsTrue(current.IsInitialRun);
        }