Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
what is an example of magic numbers?
Why should it? April is in the 2nd quarter.
Don`t work with test case Expect(QuarterOf(4)).To(Equal(1))
good as shortest solution, but not obvious with magic numbers
The tests are ok, it's your code what's wrong. And what I told you is this:
that's a single test, first the log, then the test result.
About your code, your second elif condition is the same as the if condition and overall it's not ok, that's why it's failing. You can test your code with that input in the sample tests.
Looking at the above returned log, the left elivator is on the first floor, and the right elevator is on the ground level.
The call is made on the ground level meaning that the right elevator is the closest (already on the same level). So 'left'is not the correct outcome or the exercise description is wrong.
It seems to test for the previous input for call, in that case it would be nice to add this to the description to the exercise to avoid confusion.
The log appears before the test result, and that input expects
"right"
. Check your code.Test set is wrong because of the following output:'right' should equal 'left'
Testing for: left = 1, right = 0, call = 0
In this case "right" should be the correct answer as it is on the same floor as the call int, however it still tells me the output should be left.
I have never seen an ATM that has the possibility to input - or . Besides that great exercise!