public static void ClassInitialize(TestContext context)
        {
            _database       = new Database(IdentityConstants.ConnectionName);
            _userTable      = new UserTable <IdentityUser>(_database);
            _claimTable     = new ClaimTable(_database);
            _userClaimTable = new UserClaimTable(_database);

            _clientTable = new ClientTable(_database);

            _clientTable.Insert(new IdentityClient(client));
            var TestClientId = _clientTable.GetClientByName(client).Id;

            _claimTable.Insert(new IdentityClaim(TestClientId, cType1, cValue1));
            _claimTable.Insert(new IdentityClaim(TestClientId, cType2, cValue2));


            _userTable.Insert(new IdentityUser(TestClientId, name1)
            {
                Email = email1
            });
            _userTable.Insert(new IdentityUser(TestClientId, name2)
            {
                Email = email2
            });
        }
Exemplo n.º 2
0
        public static void ClassInitialize(TestContext context)
        {
            _database    = new Database(IdentityConstants.ConnectionName);
            _userTable   = new UserTable <IdentityUser>(_database);
            _clientTable = new ClientTable(_database);
            _database.Execute("DELETE FROM User");

            _clientTable.Insert(new IdentityClient(client));
            TestClientId = _clientTable.GetClientByName(client).Id;
        }
Exemplo n.º 3
0
        public static void ClassInitialize(TestContext context)
        {
            _database       = new Database(IdentityConstants.ConnectionName);
            _roleTable      = new RoleTable(_database);
            _userTable      = new UserTable <IdentityUser>(_database);
            _userLoginTable = new UserLoginTable(_database);
            _clientTable    = new ClientTable(_database);

            _clientTable.Insert(new IdentityClient(client));
            TestClientId = _clientTable.GetClientByName(client).Id;

            _userTable.Insert(new IdentityUser(TestClientId, name1)
            {
                Email = email1
            });
            _userTable.Insert(new IdentityUser(TestClientId, name2)
            {
                Email = email2
            });
        }
 private static int CreateClient(string client)
 {
     return(_clientTable.Insert(new IdentityClient(client)));
 }