public void Should_Reject_Book_Job_Command_For_Unknown_Task_Id_With_UnknownJobError()
 {
     var request = new JobRequest {RequestedByDate = DateTime.Now.AddDays(1), RequestedTask = 1231354957};
     var sut = new JobProcessor();
     var result = sut.Process(request);
     result.Errors.Any(x => x.GetType() == typeof(UnknownJobIdError)).ShouldBeTrue();
 }
 public void Should_Execute_Valid_Book_Job_Command()
 {
     var request = new JobRequest{RequestedByDate = DateTime.Now.AddDays(14), RequestedTask = GetKnownTaskId()};
     var sut = new JobProcessor();
     var result = sut.Process(request);
     result.Accepted.ShouldBeTrue();
 }
 public void Should_Reject_Book_Job_Command_For_The_Past_With_Input_Errors()
 {
     var request = new JobRequest
         {RequestedByDate = DateTime.Now.Subtract(TimeSpan.FromDays(1)), RequestedTask = GetKnownTaskId()};
     var sut = new JobProcessor();
     var result = sut.Process(request);
     result.Errors.Any(x => x.GetType() == typeof(JobInThePastError)).ShouldBeTrue();
 }
 public void Should_Schedule_Job_Based_On_Results()
 {
     var request = new JobRequest {RequestedByDate = DateTime.Now.AddDays(14), RequestedTask = GetKnownTaskId()};
     var sut = new JobProcessor();
     var result = sut.Process(request);
     result.ScheduledToBeginOn.CompareTo(request.RequestedByDate).ShouldBeInRange(-14, 0);
 }