Example #1
0
 /// <inheritdoc />
 public MyJob(
     string jobName,
     string queueName           = "my_queue",
     AttemptOptions attempt     = null,
     ExecutionOptions execution = null
     ) : base(jobName, queueName, attempt, execution)
 {
 }
Example #2
0
 /// <inheritdoc />
 public TestJob(
     string jobName,
     string queueName           = "default",
     AttemptOptions attempt     = null,
     ExecutionOptions execution = null
     ) : base(jobName, queueName, attempt, execution)
 {
 }
Example #3
0
 /// <inheritdoc />
 public HeavyJob(
     string data,
     string jobName,
     string queueName           = "default",
     AttemptOptions attempt     = null,
     ExecutionOptions execution = null
     ) : base(jobName, queueName, attempt, execution)
 {
     Data = data;
 }
Example #4
0
        public void DeleteJob_Remove_ShouldNeverBeCalled()
        {
            // Arrange
            var job   = new TestJob("test", attempt: AttemptOptions.Infinitely());
            var queue = CreateJobQueue();

            // Act
            queue.AddLastRange(new[] { job });
            queue.TryGetJob(out var actual);
            queue.ArchiveJob(actual);

            // Assert
            queue.Count.Should().Be(0);
            _jobRepository.Verify(x => x.Remove(It.IsAny <Job>()), Times.Once);
        }