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 }); }
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; }
public void It_creates_and_inserts_new_client() { var result = 0; IdentityClient newClient; using (var transaction = _database.GetTransaction()) { result = CreateClient(client1); newClient = _clientTable.GetClientByName(client1); transaction.Dispose(); } Assert.IsNotNull(newClient.Id); Assert.IsNotNull(newClient.Base64Secret); Assert.IsTrue(newClient.Id.StartsWith("C")); Assert.AreEqual(client1, newClient.Name); Assert.AreEqual(1, result); }
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 }); }