예제 #1
0
        public void Get_Existing_Account_Returns_Account()
        {
            var account = new Account()
            {
                AccountGuid = _user.AccountGuid[0], AccountName = "davesAccount"
            };

            A.CallTo(() => _fakeIUserRepo.GetUser(_user.UserGuid)).Returns(_user);
            A.CallTo(() => _fakeIAccountRepo.GetMoneyAccount(_user.AccountGuid[0])).Returns(account);

            var adapterRepo  = new AdapterRepo(_fakeIUserRepo, _fakeIAccountRepo);
            var davesAccount = adapterRepo.GetMoneyAccount(account.AccountGuid);

            Assert.That(account.AccountGuid, Is.EqualTo(davesAccount.AccountGuid));
        }
예제 #2
0
        private void HarmonizeUserMoneyAccounts(Guid userGuid)
        {
            var user = _userRepo.GetUser(userGuid);

            foreach (var accountGuid in user.AccountGuid)
            {
                try
                {
                    _accountRepo.GetMoneyAccount(accountGuid);
                }
                catch (Exception)
                {
                    this.RemoveAccount(userGuid, accountGuid);
                }
            }
        }