overrode Equals to be able to compare Animals directly
added purity checks, since the description explicitely asks for a new list
Not backwards-compatible, because the Animal class was defined in the user file instead of preloaded, which I think is bad. Feedback is welcome, I'm not proficient in C#
the total distance driven will be the difference between the odometer reading of the last fill-up for the month, and the odometer reading of the first fill-up for the month.
Odometer wraps around at certain values, and there is no guaranteed that it will always be strictly increasing over time for the entire span of input data either (for example, if it is replaced or tampered with). Unless it is strictly increasing there will be a difference in last - first vs. max - min, so either this should be explicitly specified, or it should be specifically tested.
No random tests
C# fork
Animal
class to preloadedEquals
to be able to compareAnimal
s directlyNot backwards-compatible, because the
Animal
class was defined in the user file instead of preloaded, which I think is bad. Feedback is welcome, I'm not proficient in C#Scala translation
This comment is hidden because it contains spoiler information about the solution
C#:
Actual and expected in some fixed tests are swapped
No random tests
There are possible sources of floating point errors in the kata (mostly on
AverageLitres
), which the tests doesn't account for.Odometer wraps around at certain values, and there is no guaranteed that it will always be strictly increasing over time for the entire span of input data either (for example, if it is replaced or tampered with). Unless it is strictly increasing there will be a difference in
last - first
vs.max - min
, so either this should be explicitly specified, or it should be specifically tested.FillUp
andMonthlyFillUpSummary
should not be defined in user code space. They should be defined inPreloaded
.Description should be language-agnostic
JS: The description is misleading. There's no class here. Just arrays of plain objects.
Tests compare each property of the returned objects separately without any indication of what exactly is being tested.
No random tests.
You might want to merge both the basic tests into one.
Loading more items...