Пример #1
0
        public void Unapply_ShouldRemoveTheJob_FromTheScheduledSetAndHash()
        {
            var handler = new ScheduledState.Handler();

            handler.Unapply(_context.Object, _transaction.Object);

            _transaction.Verify(x => x.RemoveFromSet("schedule", JobId));
        }
Пример #2
0
        public void Apply_ShouldAddTheJob_ToTheScheduleSet_WithTheCorrectScore_AndInTheRightQueue()
        {
            var handler = new ScheduledState.Handler();

            handler.Apply(_context.Object, _transaction.Object);

            _transaction.Verify(x => x.AddToSetQueue(
                                    "schedule", JobId, "new_queue", JobHelper.ToTimestamp(_enqueueAt)));
        }
        public void Apply_ThrowsAnException_WhenGivenStateIsNotScheduledState()
        {
            var handler = new ScheduledState.Handler();

            _context.NewStateValue = new Mock <IState>().Object;

            Assert.Throws <InvalidOperationException>(
                () => handler.Apply(_context.Object, _transaction.Object));
        }
Пример #4
0
        public void StateName_ShouldBeEqualToScheduledState()
        {
            var handler = new ScheduledState.Handler();

            Assert.Equal(ScheduledState.StateName, handler.StateName);
        }