public async void Address1_Create_length() { Mock <IStudioRepository> studioRepository = new Mock <IStudioRepository>(); studioRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Studio())); var validator = new ApiStudioServerRequestModelValidator(studioRepository.Object); await validator.ValidateCreateAsync(new ApiStudioServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Address1, new string('A', 129)); }
public async void Address2_Update_null() { Mock <IStudioRepository> studioRepository = new Mock <IStudioRepository>(); studioRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Studio())); var validator = new ApiStudioServerRequestModelValidator(studioRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiStudioServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Address2, null as string); }
public async void Province_Update_length() { Mock <IStudioRepository> studioRepository = new Mock <IStudioRepository>(); studioRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Studio())); var validator = new ApiStudioServerRequestModelValidator(studioRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiStudioServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Province, new string('A', 91)); }