public void ThenUserHasAFederatedAccountWithName(string userName, string accountName) { Guid userId = MockDatabase.GetUser(userName).Id; IEnumerable <IAccount> accounts = IdentityManagementService.GetUserAccounts(userId); Assert.AreEqual(1, accounts.Count(a => a.Type == AccountType.Federated && a.Name == accountName)); }
public void ThenUserHasNoAssignedActiveDirectoryAccount(string userName) { Guid userId = MockDatabase.GetUser(userName).Id; IEnumerable <IAccount> accounts = IdentityManagementService.GetUserAccounts(userId); Assert.IsFalse(accounts.Any(o => o.Type == AccountType.Federated)); }
public void ThenUserHasAnAccountWithNameAndPassword(string userName, string accountName, string password) { Guid userId = MockDatabase.GetUser(userName).Id; IEnumerable <IAccount> accounts = IdentityManagementService.GetUserAccounts(userId); IAccount account = accounts.SingleOrDefault(a => a.Type == AccountType.Password && a.Name == accountName); Assert.IsNotNull(account); Assert.IsTrue(UserService.IsMatchingPassword(accountName, password)); }