public async void Name2_Update_null() { Mock <IIncludedColumnTestRepository> includedColumnTestRepository = new Mock <IIncludedColumnTestRepository>(); includedColumnTestRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new IncludedColumnTest())); var validator = new ApiIncludedColumnTestServerRequestModelValidator(includedColumnTestRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiIncludedColumnTestServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name2, null as string); }
public async void Name_Create_length() { Mock <IIncludedColumnTestRepository> includedColumnTestRepository = new Mock <IIncludedColumnTestRepository>(); includedColumnTestRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new IncludedColumnTest())); var validator = new ApiIncludedColumnTestServerRequestModelValidator(includedColumnTestRepository.Object); await validator.ValidateCreateAsync(new ApiIncludedColumnTestServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 51)); }