JaroslawWiosna / regionalizer

How to choose the best capital of a state and regions? Divider into regions, especially for administrative purposes
Mozilla Public License 2.0
2 stars 2 forks source link

unittests for the closest city. looks like some asserts keeps failing… #115

Closed kermit10000000 closed 6 years ago

kermit10000000 commented 6 years ago

… and like the function stopped working properly. since the regio class was added i am not sure if backward compability was kept with regio. Maybe something this or someother else makes the class closest city to not work properly anymore.

Signed-off-by: Wojciech Mielczarek kermit10000000@gmail.com

kermit10000000 commented 6 years ago

so we removed the calling the method complitely from our code but this was not a good thing that will now cause us check when it stopped working manually(??) I don't know really how to come out of this problem...

kermit10000000 commented 6 years ago

Ok, i understand the problem, The issue was that in my class closest city it was assumed that it is made only after the calculations of happines etc. When you moved it away from main it was pointless and pointing always on 0. Instead of a decent number variable distanceToTheClosestCity set to 0 was crushing the functionality. Because of no unittests one change delivered crashed another. That is another reason why we always have to deliver unit tests with code. Even if we will delete/change code later we prevent by that destroying the functionality without even knowing it.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+5.8%) to 53.054% when pulling 22aa058e4420648b9459a41eefc1d88fb20f1a3e on closestcityunittest into 682c195b3bfe87f6f357cc1febc5dcf45185c71c on master.