public async void Name_Update_null() { Mock <IVProductAndDescriptionRepository> vProductAndDescriptionRepository = new Mock <IVProductAndDescriptionRepository>(); vProductAndDescriptionRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new VProductAndDescription())); var validator = new ApiVProductAndDescriptionRequestModelValidator(vProductAndDescriptionRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiVProductAndDescriptionRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, null as string); }
public async void Description_Create_length() { Mock <IVProductAndDescriptionRepository> vProductAndDescriptionRepository = new Mock <IVProductAndDescriptionRepository>(); vProductAndDescriptionRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new VProductAndDescription())); var validator = new ApiVProductAndDescriptionRequestModelValidator(vProductAndDescriptionRepository.Object); await validator.ValidateCreateAsync(new ApiVProductAndDescriptionRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Description, new string('A', 401)); }