public async void PasswordSalt_Update_null() { Mock <IPasswordRepository> passwordRepository = new Mock <IPasswordRepository>(); passwordRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Password())); var validator = new ApiPasswordRequestModelValidator(passwordRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiPasswordRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.PasswordSalt, null as string); }
public async void PasswordHash_Create_length() { Mock <IPasswordRepository> passwordRepository = new Mock <IPasswordRepository>(); passwordRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Password())); var validator = new ApiPasswordRequestModelValidator(passwordRepository.Object); await validator.ValidateCreateAsync(new ApiPasswordRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.PasswordHash, new string('A', 129)); }