コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
ファイル: AuthQueries.cs プロジェクト: singlag888/aft-regov2
        public ValidationResult GetValidationResult(LoginActor model)
        {
            var validator = new LoginValidator(_repository);

            return(validator.Validate(model));
        }