예제 #1
0
        public async void PipelineStepStatusId_Update_Valid_Reference()
        {
            Mock <IPipelineStepRepository> pipelineStepRepository = new Mock <IPipelineStepRepository>();

            pipelineStepRepository.Setup(x => x.GetPipelineStepStatus(It.IsAny <int>())).Returns(Task.FromResult <PipelineStepStatus>(new PipelineStepStatus()));

            var validator = new ApiPipelineStepRequestModelValidator(pipelineStepRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiPipelineStepRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.PipelineStepStatusId, 1);
        }
예제 #2
0
        public async void ShipperId_Create_Valid_Reference()
        {
            Mock <IPipelineStepRepository> pipelineStepRepository = new Mock <IPipelineStepRepository>();

            pipelineStepRepository.Setup(x => x.GetEmployee(It.IsAny <int>())).Returns(Task.FromResult <Employee>(new Employee()));

            var validator = new ApiPipelineStepRequestModelValidator(pipelineStepRepository.Object);
            await validator.ValidateCreateAsync(new ApiPipelineStepRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.ShipperId, 1);
        }