public async void PipelineStepId_Create_Invalid_Reference() { Mock <IOtherTransportRepository> otherTransportRepository = new Mock <IOtherTransportRepository>(); otherTransportRepository.Setup(x => x.GetPipelineStep(It.IsAny <int>())).Returns(Task.FromResult <PipelineStep>(null)); var validator = new ApiOtherTransportRequestModelValidator(otherTransportRepository.Object); await validator.ValidateCreateAsync(new ApiOtherTransportRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.PipelineStepId, 1); }
public async void HandlerId_Update_Invalid_Reference() { Mock <IOtherTransportRepository> otherTransportRepository = new Mock <IOtherTransportRepository>(); otherTransportRepository.Setup(x => x.GetHandler(It.IsAny <int>())).Returns(Task.FromResult <Handler>(null)); var validator = new ApiOtherTransportRequestModelValidator(otherTransportRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiOtherTransportRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.HandlerId, 1); }