Apply() public method

public Apply ( Hangfire.States.ApplyStateContext context, IWriteOnlyTransaction transaction ) : void
context Hangfire.States.ApplyStateContext
transaction IWriteOnlyTransaction
return void
        public void Apply_AddsJob_ToTheSpecifiedQueue()
        {
            var handler = new EnqueuedState.Handler();

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

            _transaction.Verify(x => x.AddToQueue(Queue, _context.BackgroundJob.Id));
        }
Ejemplo n.º 2
0
        public void Apply_ThrowsAnException_WhenOtherThanEnqueuedStateGiven()
        {
            var handler = new EnqueuedState.Handler();
            _context.NewStateValue = new Mock<IState>().Object;

            Assert.Throws<InvalidOperationException>(
                () => handler.Apply(_context.Object, _transaction.Object));
        }