https://github.com/benruehl/tariff-comparison-exercise
An exercise consisting of a .NET Core 2.2 web application which has an API to compare the costs of different tariffs
https://github.com/benruehl/tariff-comparison-exercise
csharp dotnet-core
Last synced: over 1 year ago
JSON representation
An exercise consisting of a .NET Core 2.2 web application which has an API to compare the costs of different tariffs
- Host: GitHub
- URL: https://github.com/benruehl/tariff-comparison-exercise
- Owner: benruehl
- License: mit
- Created: 2019-09-12T21:47:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-12T21:49:47.000Z (almost 7 years ago)
- Last Synced: 2025-02-14T07:48:16.603Z (over 1 year ago)
- Topics: csharp, dotnet-core
- Language: C#
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tariff Comparison Exercise
This demo project consists of a .NET Core 2.2 web application which has an API to compare the costs of different tariffs.
## Endpoints
It offers a single endpoint to retrieve two tariffs:
```
GET {base-url}/api/v1/tariffs/by-annual-consumption/{annual-consumption-in-kWh}
```
Example:
```
GET https://localhost:44316/api/v1/tariffs/by-annual-consumption/4500
```
Given the annual consumption in kWh the application returns the tariffs for example like so:
```json
[
{
"name": "Packaged tariff",
"annualCosts": 950.0
},
{
"name": "basic electricity tariff",
"annualCosts": 1050.0
}
]
```
The tariffs are sorted by costs in ascending order.
## Development
The application is developed using Visual Studio 2019. Tests are provided using xUnit and Moq.