Beispiel #1
0
        public void GetAccountByIdHandlesAccountNotFound()
        {
            const int requestedAccountId = 1;

            var repository = new InMemoryBankAccountRepository();

            var locatedAccount = repository.GetAccountById(requestedAccountId);

            Assert.That(locatedAccount, Is.Null);
        }
Beispiel #2
0
        public void GetAccountByIdCanLocateAccount()
        {
            const int    userId        = 1;
            const string bankId        = "TestBank";
            const string accountNumber = "12346578";

            var repository = new InMemoryBankAccountRepository();

            var createdAccount = repository.CreateAccount(userId, bankId, accountNumber);
            var locatedAccount = repository.GetAccountById(createdAccount.Id);

            Assert.That(createdAccount, Is.EqualTo(locatedAccount));
        }