forked from S-DRE/Bank-Kata_C-Sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GREEN: Started unit testing Account, first unit test passing
- Loading branch information
Showing
8 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,9 @@ | ||
namespace Bank; | ||
|
||
public class Wallet : WalletRepository | ||
{ | ||
public void add(int amount) | ||
{ | ||
throw new NotImplementedException("NOT IMPLEMENTED: Wallet repository not implemented"); | ||
} | ||
} |
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,6 @@ | ||
namespace Bank; | ||
|
||
public interface WalletRepository | ||
{ | ||
public void add(int amount); | ||
} |
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,23 @@ | ||
using Bank; | ||
using Moq; | ||
|
||
namespace AccountShould; | ||
|
||
public class AccountShould | ||
{ | ||
private Account account; | ||
|
||
private Mock<WalletRepository> walletRepository = new(); | ||
|
||
|
||
public AccountShould() | ||
{ | ||
account = new Account(new ProConsole(), new DateCreator(), walletRepository.Object); | ||
} | ||
|
||
[Fact] | ||
public void DepositTheGivenAmountAndSaveTheValue() { | ||
account.Deposit(1000); | ||
walletRepository.Verify(wallet => wallet.add(1000)); | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.