Exemple #1
0
        public async void EnvironmentId_Update_length()
        {
            Mock <IDeploymentRepository> deploymentRepository = new Mock <IDeploymentRepository>();

            deploymentRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new Deployment()));

            var validator = new ApiDeploymentRequestModelValidator(deploymentRepository.Object);
            await validator.ValidateUpdateAsync(default(string), new ApiDeploymentRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.EnvironmentId, new string('A', 51));
        }
Exemple #2
0
        public async void DeployedBy_Create_length()
        {
            Mock <IDeploymentRepository> deploymentRepository = new Mock <IDeploymentRepository>();

            deploymentRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new Deployment()));

            var validator = new ApiDeploymentRequestModelValidator(deploymentRepository.Object);
            await validator.ValidateCreateAsync(new ApiDeploymentRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.DeployedBy, new string('A', 201));
        }