public void Invalid_actorId_is_not_valid_for_login() { var model = new LoginActor(); var result = _authQueries.GetValidationResult(model); result.IsValid.Should().BeFalse(); result.Errors.Single().ErrorMessage.Should().Be(ErrorsCodes.ActorDoesNotExist.ToString()); }
public void Invalid_password_is_not_valid_for_login() { var createActor = new CreateActor { ActorId = Guid.NewGuid(), Password = TestDataGenerator.GetRandomString(), Username = TestDataGenerator.GetRandomString() }; _authCommands.CreateActor(createActor); var loginActor = new LoginActor { ActorId = createActor.ActorId, Password = TestDataGenerator.GetRandomString() }; var result = _authQueries.GetValidationResult(loginActor); result.IsValid.Should().BeFalse(); result.Errors.Single().ErrorMessage.Should().Be(ErrorsCodes.ActorPasswordIsNotValid.ToString()); }
public ValidationResult GetValidationResult(LoginActor model) { var validator = new LoginValidator(_repository); return(validator.Validate(model)); }