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.
This comment is hidden because it contains spoiler information about the solution
Please note that in the description, the "main" category that we have to filter by is not the string "MainCategory" but the most common category present in that particular test case. If my categories are
["Red", "Red", "Green", "Blue"]
then the "main category" is "Red".To your last sentence: you can print the test inputs to see what's going on.
Your issue with the order of the assertion arguments is correct.
The Tests of C# have some mistakes.
First, the question description said "{Category = "Main Category", Name = "Camera 1"}", but in the example test, the Category it set is "MainCategory", it lost the space.
Second, the "Assert.AreEqual(checker.Count, 5);" statement is wrong. You should write down "Assert.AreEqual(5, checker.Count);".
And I don't know why my code can pass the example test but only get zero elements in the other tests. I don't know if there are other errors in the tests that I can't see.
Thanks a lot, myjinxin2015.
Bug in the test was successfully fixed.
Now list is always shuffled.
OK,try it later
;-)
There is only one test.
And its called now 50 times with different number of list items. (I had add 29 more tests)
From few items up to 199999 or close to this number. (there is random number of "not main category" items, so cannot tell for sure)
I had check my code with additional load (tried to check list with close to 1999999 items) and its fail with the same error as yours.
So absolutely sure you have too slow algorythm and you need to improve it for pass this kata.
Can you tell me something about test-14?
I can't use Console.WriteLine to print it
so I am hard to thinking what's wrong with me...
All the tests used absolutely the same code for random generation of the List<> items.
So absolutely sure they all are correct :)
My code giving the following result:
21 Passed
0 Failed
0 Errors
Process took 523ms to complete
Try to run once more.
If this will not resolve your issue - possibly, you have problems with your algorythm and you need to optimize your code and make if faster.
When I passed 13 test, show me this infomation:
any hint? or your testcase has some problem?
CleanUp.TestFinal
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
CheckCleanUp
Test Passed
Process was terminated. It took longer than 6000ms to complete
13 Passed
0 Failed
0 Errors
Not sure if you're joking or not, so here's a nice article to read: http://simpleprogrammer.com/2015/04/13/why-comments-are-stupid-a-real-example/
much more horible solution :D Have no idea who mark it as best practice :D
Too difficult logic, too much code for such task. Cannot be best practice.
This solution must not pass! Looks like author didnt write correct tests for such solutions.
(its using in bank only 25$ money, even if people giving 50$ money or 100$ money)
Clever, but too hard to read the code.
So "clever", but not the "best practice" absolutely sure. Good code -- easy for read code first at all. Shortest code is not always easy to read.
Ok, what do you think about this: http://www.codewars.com/kata/reviews/56f25758a79ad3a02c000045/groups/56f2772775e34065720005f1
Loading more items...