public async Task Ldap_ClientLoginTest()
        {
            var userName     = "******";
            var testPassword = "******";

            var passwordGenerator     = container.Resolve <IPasswordGenerator>();
            var passwordGeneratorMock = Mock.Get(passwordGenerator);

            passwordGeneratorMock.Setup(p => p.HashPassword(It.IsAny <string>())).Returns(testPassword);
            passwordGeneratorMock.Setup(p => p.CheckPassword(It.IsAny <string>(), It.IsAny <string>())).Returns(true);

            var ldapClient     = container.Resolve <ILdapClient>();
            var ldapClientMock = Mock.Get(ldapClient);

            ldapClientMock
            .Setup(x => x.Authorize(It.IsAny <string>(), It.IsAny <string>()))
            .Returns((string name, string pass) => Task.FromResult(new LdapUser {
                Email = name
            }));

            var accountRepository     = container.Resolve <IAccountRepository>();
            var accountRepositoryMock = Mock.Get(accountRepository);

            accountRepositoryMock
            .Setup(x => x.FindByLogin(It.IsAny <string>()))
            .Returns <string>(x =>
                              Task.FromResult(new Account {
                Login = x
            }));


            var permissionRepository     = container.Resolve <IPermissionRepository>();
            var permissionRepositoryMock = Mock.Get(permissionRepository);

            permissionRepositoryMock
            .Setup(p => p.GetByUserId(It.IsAny <int>()))
            .ReturnsAsync(new[] { new Repository.Model.Permission() });

            using (var http = new HttpClient())
            {
                var client   = new Domain0Client(TEST_URL, http);
                var response = await client.LoginByDomainUserAsync(new Api.Client.ActiveDirectoryUserLoginRequest(testPassword, userName));

                Assert.NotNull(response.AccessToken);
            }

            accountRepositoryMock.Verify(t => t.FindByLogin(It.Is <string>(e => e == userName)), Times.Once);
        }