This is a TDD exercise SQLI Morocco used as a challenge in a recruitment campaign
It’s about vehicles and their door sensors. A vehicle is displayed as bellow:
_
door 1 | | door 2
door 3 |_| door 4
For example to represent the vehicle with door 2 and 3 as open:
_
door 1 | \ door 2
door 3 /_| door 4
In plus, each vehicle has a different consumption according to its Fuel type:
Diesel: 5%
Gasoline: 6%
Hybrid: 3%
Context
After at least 8 months of full time programming with PHP/Symfony, I needed to get back to Java and keep my brain JVM compiler alive… and it was raining all this weekend :)
So it was a perfect memory-refresh for me and I think it can also play a nice code kata theme.
Main test class
You can find my first solution in this GitHub repo