public async Task QuandOnSeConnecte()
        {
            if (_login == _validLogin)
            {
                _user = new User()
                {
                    Login    = _login,
                    Password = _validPassword,
                    NbTentativesConnexions = _nbTentativesConnexions
                };
            }
            _credentialRepository = AuthenticationUtility.BuildCredentialsRepository(_user);
            var controller =
                new AuthenticationController(
                    new AuthenticationUseCase(
                        AuthenticationUtility.BuildTokenRepository(new DateTime(2049, 05, 17)),
                        _credentialRepository));

            var authenticationDto = new AuthenticationDto()
            {
                Login    = this._login,
                Password = this._password
            };

            this._actual = await controller.ConnectAsync(authenticationDto);
        }
Example #2
0
        public async Task WhenWeCheckTheAuthentication()
        {
            var controller =
                new AuthenticationController(
                    new AuthenticationUseCase(
                        AuthenticationUtility.BuildTokenRepository(_expirationDate),
                        AuthenticationUtility.BuildCredentialsRepository(null)));

            await ProcessGetAsync(controller);
        }
Example #3
0
        public async Task QuandOnVerifieLAuthentification()
        {
            var controller =
                new AuthenticationController(
                    new AuthenticationUseCase(
                        AuthenticationUtility.BuildTokenRepository(_expirationDate),
                        AuthenticationUtility.BuildCredentialsRepository(null)));

            _actual = await controller.GetAsync(Guid.Empty.ToString(), _now);
        }