예제 #1
0
        public async void PipelineStepId_Create_Valid_Reference()
        {
            Mock <IPipelineStepDestinationRepository> pipelineStepDestinationRepository = new Mock <IPipelineStepDestinationRepository>();

            pipelineStepDestinationRepository.Setup(x => x.PipelineStepByPipelineStepId(It.IsAny <int>())).Returns(Task.FromResult <PipelineStep>(new PipelineStep()));

            var validator = new ApiPipelineStepDestinationServerRequestModelValidator(pipelineStepDestinationRepository.Object);
            await validator.ValidateCreateAsync(new ApiPipelineStepDestinationServerRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.PipelineStepId, 1);
        }
예제 #2
0
        public async void DestinationId_Update_Valid_Reference()
        {
            Mock <IPipelineStepDestinationRepository> pipelineStepDestinationRepository = new Mock <IPipelineStepDestinationRepository>();

            pipelineStepDestinationRepository.Setup(x => x.DestinationByDestinationId(It.IsAny <int>())).Returns(Task.FromResult <Destination>(new Destination()));

            var validator = new ApiPipelineStepDestinationServerRequestModelValidator(pipelineStepDestinationRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiPipelineStepDestinationServerRequestModel());

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