public async void PipelineStepId_Create_Valid_Reference() { Mock <IHandlerPipelineStepRepository> handlerPipelineStepRepository = new Mock <IHandlerPipelineStepRepository>(); handlerPipelineStepRepository.Setup(x => x.PipelineStepByPipelineStepId(It.IsAny <int>())).Returns(Task.FromResult <PipelineStep>(new PipelineStep())); var validator = new ApiHandlerPipelineStepServerRequestModelValidator(handlerPipelineStepRepository.Object); await validator.ValidateCreateAsync(new ApiHandlerPipelineStepServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.PipelineStepId, 1); }
public async void HandlerId_Update_Valid_Reference() { Mock <IHandlerPipelineStepRepository> handlerPipelineStepRepository = new Mock <IHandlerPipelineStepRepository>(); handlerPipelineStepRepository.Setup(x => x.HandlerByHandlerId(It.IsAny <int>())).Returns(Task.FromResult <Handler>(new Handler())); var validator = new ApiHandlerPipelineStepServerRequestModelValidator(handlerPipelineStepRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiHandlerPipelineStepServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.HandlerId, 1); }