This project is a small part of a banking system for a fictional company called Acme Bank, implemented using C#. The project focuses on managing two types of accounts, Savings Account and Current Account, and implements basic functionalities like deposit and withdrawal.
- Savings Account
- Current Account
The following functionalities are implemented for both account types:
-
Deposit:
- A Savings Account can only be opened with a minimum deposit of R1000.00.
- A Savings Account's balance increases by the amount deposited.
- A Current Account has no minimum deposit requirement, and its balance increases by the amount deposited.
-
Withdraw:
- A Savings Account must maintain a minimum balance of R1000.00.
- A Savings Account's balance decreases by the amount withdrawn.
- A Current Account can have an overdraft limit, with the maximum overdraft allowed being R100,000.00.
- A Current Account's balance can be both positive or negative depending on the overdraft limit.
- The code is structured in a layered architecture style using Domain, Application, and Infrastructure layers.
- The primary classes involved are
SavingsAccount,CurrentAccount, andSystemDB(an in-memory database implemented as a singleton). - The functionalities are tested using unit tests implemented in the
AcmeBank.Testsproject.
- AccountNotFoundException: Thrown when an attempt is made to perform an operation on a non-existent account.
- WithdrawalAmountTooLargeException: Thrown when a withdrawal attempt exceeds the allowed balance plus overdraft limit for a Current Account or violates the minimum balance rule for a Savings Account.
- Domain Layer: Contains core classes
Account,SavingsAccount,CurrentAccount, and exceptions. - Application Layer: Contains services like
AccountServiceto manage account operations. - Infrastructure Layer: Contains the
SystemDBclass which acts as an in-memory database.
The project includes the following unit tests to ensure correct functionality:
- Test Withdraw from Savings Account
- Test Withdraw from Current Account
- Test Deposit to Savings Account
- Test Deposit to Current Account
- Test Account Not Found Exception
To run this project:
- Clone the repository from GitHub.
- Open the solution in Visual Studio.
- Build the solution to restore the necessary packages.
- Run the unit tests to verify the functionality.
- The project uses integers to represent monetary values for simplicity.
- The in-memory database is pre-populated with a few hardcoded accounts.
- The project does not include a User Interface.
- The code is written with basic error handling, focusing on essential functionality rather than a production-level implementation.
This project is licensed under the MIT License - see the LICENSE file for details.
This project was completed as part of an assessment to demonstrate knowledge and skills in software development. The project involved creating a small part of a banking system for a fictional company, Acme Bank, focusing on account management functionalities.
Note: The company's name has been intentionally omitted from this README to maintain confidentiality.