示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }