Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1- I have made changes in the fee collecting algorithm, where the time spans were not divided correctly, also after one hour passes from the last toll passage the time pin missed an update, it fixed that.
2 - Since the data model was very simple there was no deep SOLID/ OOD approach needed. This challenge was not on the objective part of models but was more on how unrelated the data model and calculation logic was from each other. A data driven approach was the best to be applied.
3- from C# version 8 the pattern matching was introduced to help with complexities which are apart from model structure and was best to be used in such Logic layers of software for sake of making
A- logic layer very simple to read
B- test and usage of logic to become much faster and lest bulk of code is needed.
finally a unit test is created for the sake of proving the 2 public method inside calculator to be working.
and one console app is doing simple work of a calculator for a costumer whom wondering how much fee is to be paid :D