public void Should_Reject_Request_For_Unknown_Task()
 {
     var request = new JobRequest
         {IsEmergency = true, RequestedByDate = DateTime.Now.AddDays(1), RequestedTask = 12345674};
     var sut = new EmergencyRequestValidator();
     var result = sut.Validate(request);
     result.Errors.Any(x => x.GetType() == typeof(UnknownJobValidationError)).ShouldBeTrue();
 }
 public void Should_Accept_all_other_Requests()
 {
     var request = new JobRequest
         {IsEmergency = true, RequestedByDate = DateTime.Now.AddDays(1), RequestedTask = GetKnownTaskId()};
     var sut = new EmergencyRequestValidator();
     var result = sut.Validate(request);
     result.IsValid.ShouldBeTrue();
 }
 public void Should_Reject_Request_For_Date_In_The_Past()
 {
     var request = new JobRequest
         {
             IsEmergency = true,
             RequestedByDate = DateTime.Now.Subtract(TimeSpan.FromDays(1)),
             RequestedTask = GetKnownTaskId()
         };
     var sut = new EmergencyRequestValidator();
     var result = sut.Validate(request);
     result.Errors.Any(x => x.GetType() == typeof (DateInThePastValidationError)).ShouldBeTrue();
 }