コード例 #1
0
        public void Add_New_Account_To_User_Returns_User_With_That_Account()
        {
            var account = new Account()
            {
                AccountGuid = _user.AccountGuid[0], AccountName = "davesAccount"
            };

            A.CallTo(() => _fakeIUserRepo.GetUser(_users[1].UserGuid)).Returns(_users[1]);
            A.CallTo(() => _fakeIAccountRepo.GetMoneyAccount(A <Guid> .Ignored)).Returns(null);
            A.CallTo(() => _fakeIAccountRepo.CreateMoneyAccount(account.AccountName)).Returns(account.AccountGuid);

            var adapterRepo    = new AdapterRepo(_fakeIUserRepo, _fakeIAccountRepo);
            var isAccountAdded = adapterRepo.CreateMoneyAccountForUser(_users[1].UserGuid, account.AccountName);

            Assert.That(true, Is.EqualTo(isAccountAdded));
        }
コード例 #2
0
 private Guid CreateMoneyAccount(string accountName)
 {
     return(_accountRepo.CreateMoneyAccount(accountName));
 }