public async Task CreateUser_Invalid_UserName_Should_Return_Validation_Error() { var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(userName: "******")); response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.UserName)); }
public async Task CreateUser_With_Incorrectly_Repeated_Password_Should_Return_Validation_Error() { var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(password: "******", rePassword: "******")); response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.RepeatedPassword)); }
public async Task CreateUser_Invalid_Email_Should_Return_Validation_Error() { var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(email: "invalid")); response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.Email)); }