public async Task Reset_Password_Throws_Error_If_Reset_Password_Identifier_Does_Not_Exist()
        {
            // arrange

            _resetIdentifier = null;

            // act

            var task = _service.ResetPasswordAsync(Login, Password, ResetPasswordIdentifier);

            // assert

            await Assert.ThrowsAsync <IdentifierDoesNotExistException>(async() => await task);
        }
        public async Task Validate_Reset_Identifier_Throws_Error_If_Does_Not_Exist()
        {
            // arrange

            _resetIdentifier = null;

            // act

            var task = _service.ValidateResetIdentifierAsync(Guid.NewGuid().ToString());

            // assert

            await Assert.ThrowsAsync <IdentifierDoesNotExistException>(async() => await task);
        }
        public AdminCredentialsServiceTests()
        {
            _adminCredentials = new AdminCredentials {
                AdminId = Guid.NewGuid().ToString(), Login = Login
            };
            _adminCredentials.SetPassword(Password);

            var date = DateTime.UtcNow;

            _resetIdentifier = new ResetIdentifier("AdminId", ResetPasswordIdentifier, date, date.AddMinutes(1));

            _adminCredentialsRepositoryMock.Setup(o => o.GetByLoginAsync(It.IsAny <string>()))
            .Returns((string login) => Task.FromResult(_adminCredentials));

            _passwordResetRepositoryMock.Setup(o => o.GetByIdentifierAsync(It.IsAny <string>()))
            .Returns((string resetIdentifier) => Task.FromResult <IResetIdentifier>(_resetIdentifier));

            _service = new AdminCredentialsService(
                _adminCredentialsRepositoryMock.Object,
                _passwordResetRepositoryMock.Object,
                _resetIdentifierServiceMock.Object,
                EmptyLogFactory.Instance);
        }