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.
For sure a nice Kata, but yes the 4 test case is bugged.
Get the same exception for testing purpose did catch the NullReferenceException, saying values differ at index 0,1.
there is an issue with c#.
We should had this test
int[] peopleInLine = new int[] { 25, 25, 50, 50, 50 }; This should give "NO".
But there is solutions, tagged as best pratice and clever that answer "YES" to this test case and still pass the official test that validate their solution.
As UKS notice, this solution should not pass.
If you use the following entry :
int[] peopleInLine = new int[] { 25, 25, 50, 50, 50 };
The correct answer is "NO". When the last person want to pay; we only have 50$ bill; so we are unable to give back 25$
But, when you launch this code; it will answer "YES".
I check this code with the submite button. It really success in passing the test.
I think; it lack some test that will show that this code is failling.
Please consider completing the code within one function, do not call recursive.
This is the only reason that I can think of.
For unknown reasons, when I add you code; mycode is validate with 3 successfull test.
But, without you code; I pass 8 out of 9 tests.
Some side effect of your code is that, now, we only pass the 3 firsts test. The forth one(the one failling with my code) is not executed.
Your comment confirm that the test for this excercise are bugged.
I've got the same exception on that test case. To get a better understanding of the problem I added the following to the beginning of my solution to simply print the array on screen.
For unknown reasons I pass every test with those lines added, while removing them results in the NullReferenceException.
This comment is hidden because it contains spoiler information about the solution
paste your code here and mark it as having spoiler content.
My code works fine, perhaps your code has some problems ;-)
I've got this error when I submit.
But it doesn't seems to come from my code.
TestLargeRandom
SetUp : System.NullReferenceException : Object reference not set to an instance of an object
at NUnit.Core.NUnitFramework.GetResultState (System.Exception ex) <0x42051050 + 0x0004c> in :0
at NUnit.Core.TestMethod.RunTest () <0x42047ea0 + 0x0014d> in :0
Is it a problem with the test runner? Or do you think there is something in my code that can trigger this message?