コード例 #1
0
        public void Unapply_DoesNotDoAnything()
        {
            var handler = new EnqueuedState.Handler();

            // Does not throw
            handler.Unapply(null, null);
        }
コード例 #2
0
        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));
        }
コード例 #3
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));
        }
コード例 #4
0
 public void HandlerShouldBeRegistered_ForTheEnqueuedState()
 {
     var handler = new EnqueuedState.Handler();
     Assert.Equal(EnqueuedState.StateName, handler.StateName);
 }
コード例 #5
0
        public void Unapply_DoesNotDoAnything()
        {
            var handler = new EnqueuedState.Handler();

            Assert.DoesNotThrow(() => handler.Unapply(null, null));
        }