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)); }
public void Apply_ShouldAddTheJob_ToTheScheduleSet_WithTheCorrectScore() { var handler = new ScheduledState.Handler(); handler.Apply(_context.Object, _transaction.Object); _transaction.Verify(x => x.AddToSet( "schedule", JobId, JobHelper.ToTimestamp(_enqueueAt))); }