Think of your personal bank account experience. When in doubt, go for the simplest solution.
Create a bank application with the following features:
- Deposit into Account
- Withdraw from an Account
- Print a bank statement to the console
Statement should have transactions in the following format:
DATE | AMOUNT | BALANCE
------------|---------|--------
14/01/2020 | -500.00 | 2500.00
13/01/2020 | 2000.00 | 3000.00
10/01/2020 | 1000.00 | 1000.00
Start with a class which has the following structure:
public class Account
{
public void Deposit(int amount);
public void Withdrawal(int amount);
public void PrintStatement();
}NOTE: You are not allowed to add any other public method to this class.
-
Run Program
Use the .NET Core CLI to run the application.
dotnet run --project "./src/Bank.Kata.App/Bank.Kata.App.csproj" -
Run Tests
Use the .NET Core CLI to run the tests for the application.
dotnet run --project "./test/Bank.Kata.App.Tests/Bank.Kata.App.Tests.csproj"
A quick look at the top-level files and directories you'll see in the project.
.
├── src
├── test
├── .editorconfig
├── .gitattributes
├── .gitignore
├── Bank.Kata.sln
└── README.md
-
/src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.srcis a convention for “source code”. -
/test: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.srcis a convention for “source code”. -
.editorconfig: This file helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. -
.gitattributes: This file allows you to specify the files and paths attributes that should be used by git when performing git actions, such as git commit, etc. -
.gitignore: This file tells git which files it should not track / not maintain a version history for. -
Bank.Kata.sln: This file is used to load the information associated with the solution such as projects and any other required information. -
README.md: A text file containing useful reference information about your project.