diff --git a/src/Optivem.Kata.Banking.Infrastructure/BankAccountRepository.cs b/src/Optivem.Kata.Banking.Infrastructure/BankAccountRepository.cs new file mode 100644 index 0000000..1f669cd --- /dev/null +++ b/src/Optivem.Kata.Banking.Infrastructure/BankAccountRepository.cs @@ -0,0 +1,28 @@ +using Optivem.Kata.Banking.Core.Domain.BankAccounts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Optivem.Kata.Banking.Infrastructure +{ + public class BankAccountRepository : IBankAccountRepository + { + public void Add(BankAccount bankAccount) + { + throw new NotImplementedException(); + } + + public Task GetByAccountNumberAsync(AccountNumber accountNumber) + { + var bankAccount = (BankAccount?) null; + return Task.FromResult(bankAccount); + } + + public void Update(BankAccount bankAccount) + { + throw new NotImplementedException(); + } + } +} diff --git a/test/Optivem.Kata.Banking.Test/Infrastructure/BankAccountRepositoryTest.cs b/test/Optivem.Kata.Banking.Test/Infrastructure/BankAccountRepositoryTest.cs new file mode 100644 index 0000000..697325f --- /dev/null +++ b/test/Optivem.Kata.Banking.Test/Infrastructure/BankAccountRepositoryTest.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using Optivem.Kata.Banking.Core.Domain.BankAccounts; +using Optivem.Kata.Banking.Infrastructure; +using Optivem.Kata.Banking.Test.Common.Builders.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Optivem.Kata.Banking.Test.Infrastructure +{ + public class BankAccountRepositoryTest + { + private readonly BankAccountRepository _repository; + + public BankAccountRepositoryTest() + { + _repository = new BankAccountRepository(); + } + + [Fact] + public async Task Should_return_null_given_non_existent_account_number() + { + var accountNumber = AccountNumber.From(BankAccountDefaults.DefaultAccountNumber); + + // TODO: VC: Refactor name + var bankAccount = await _repository.GetByAccountNumberAsync(accountNumber); + + bankAccount.Should().BeNull(); + } + } +}