public async void Database_Version_Update_length() { Mock <IAWBuildVersionRepository> aWBuildVersionRepository = new Mock <IAWBuildVersionRepository>(); aWBuildVersionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new AWBuildVersion())); var validator = new ApiAWBuildVersionRequestModelValidator(aWBuildVersionRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiAWBuildVersionRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Database_Version, new string('A', 26)); }
public async void Database_Version_Create_null() { Mock <IAWBuildVersionRepository> aWBuildVersionRepository = new Mock <IAWBuildVersionRepository>(); aWBuildVersionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new AWBuildVersion())); var validator = new ApiAWBuildVersionRequestModelValidator(aWBuildVersionRepository.Object); await validator.ValidateCreateAsync(new ApiAWBuildVersionRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Database_Version, null as string); }