-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#25 Infrastructure - BankAccountRepository - EF
- Loading branch information
1 parent
c754a8a
commit fae0649
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Optivem.Kata.Banking.Infrastructure/BankAccountRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<BankAccount?> GetByAccountNumberAsync(AccountNumber accountNumber) | ||
{ | ||
var bankAccount = (BankAccount?) null; | ||
return Task.FromResult(bankAccount); | ||
} | ||
|
||
public void Update(BankAccount bankAccount) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/Optivem.Kata.Banking.Test/Infrastructure/BankAccountRepositoryTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |