OrderProcessingApp is a .NET console application that processes orders for a pizzeria.
- src/: Application source code (models, processors, validators, loaders, outputs, etc.)
- input/: Contains input data files in JSON format:
orders.jsonproducts.jsoningredients.json
- tests/: Unit tests for the application
All input files are located in the input folder at the project root:
- orders.json: List of orders, each with properties like
OrderId,ProductId,Quantity,CreatedAt,DeliveryAt, andDeliveryAddress. - products.json: List of products, each with
ProductId,Name, andPrice. - ingredients.json: Dictionary mapping each
ProductIdto a list of required ingredients and their amounts.
- Ensure .NET 8 SDK is installed on your machine.
- Restore dependencies (if needed):
dotnet restore
- Build the project:
dotnet build
You can run the application from the console in two ways:
dotnet run --project src/OrderProcessingApp.csprojcd src
dotnet run- You can also run the application using the Run button from the top menu in Visual Studio or your preferred IDE.
When you run the application, it will:
- Load orders, products, and ingredients from the
inputfolder. - Validate and Process each order.
- For valid orders, print:
- Valid order details.
- The total price for each order.
- The total amount of each ingredient required for all valid orders.
- If no valid orders are found, it will display a message accordingly.
You can run the unit tests in two ways:
From the project root, run:
dotnet test- Go to Test > Test Explorer from the top menu.
- Click the Run All button to execute all tests, or right-click individual tests to run/debug them.