A simple calculator web application built with ASP.NET Core 9 (Backend API) and Angular 16+ (Frontend UI).
✅ Perform basic arithmetic operations: Add and Subtract
✅ API built with .NET 9 using RESTful endpoints
✅ Frontend built with Angular 16+
✅ Unit-tested using xUnit
Ensure you have the following installed:
-
Visual Studio / Rider / VS Code (any .NET IDE)
-
Node.js (LTS) (includes npm)
-
Angular CLI
Install it globally (if not installed):
npm install -g @angular/cli
git clone https://github.com/your-repository/calculator-app.git
cd calculator-app
cd Calculator.API
dotnet restore
dotnet run
The API will start at https://localhost:5101/.
Use Scalar UI to test endpoints:
👉 Open: https://localhost:5101/scalar
| Endpoint | Method | Example |
|----------|--------|---------|
| http://localhost:5101/api/calculator/add?start=10&amount=5 | GET | Returns 15 |
| http://localhost:5101/api/calculator/subtract?start=12&amount=6 | GET | Returns 6 |
cd Calculator.UI
npm install
ng serve --open
👉 The UI will open in your browser at:
http://localhost:4200/
To run unit tests for the Calculator Service, navigate to the test project:
cd Calculator.Tests
dotnet test
✅ All tests should pass successfully!
Developed by [Elizabeth Adegunwa]
🔗 GitHub: github.com/your-profile
📧 Email: your-email@example.com