Ad
  • Custom User Avatar
    error CS1502: The best overloaded method match for `NUnit.Framework.Assert.AreEqual(object, object, string, params object[])' has some invalid arguments
    error CS1503: Argument `#3' cannot convert `double' expression to type `string'
    
  • Default User Avatar

    Either the ordering criteria of the returned data needs to be dropped or this kata needs to be completely reworked. Depending on how the dictionary is constructed, these tests can and will fail. The only reason this code appears to work for some people at all is because of the limited number of ways these few elements tend to change their orders when hashed. The test code only works by coincidence, if it works at all. The .NET documentation is very clear: For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair<TKey, TValue> structure representing a value and its key. The order in which the items are returned is undefined.. When you call ToList on a Dictionary, you are doing exactly that, enumerating into a new list. Any code that relies on the elements of that list being well-sorted is going to have to sort them on its own, and if we are only able to return a Dictionary, we have no control over that. Ask for an array of string,int tuples or something.

  • Custom User Avatar

    JS version: no random tests :(

  • Default User Avatar

    The initial (default) solution should return an array

  • Default User Avatar

    I can't understand what could be wrong in my code. What does expected 2 and what does got 3?

    Test Results:
    ClimberRankingsTests
    TestClimberByRank (1 Passed, 0 Failed)
    TestClimberByRank (1 Passed, 0 Failed)
    TestClimberByRank
    Log
    SKOFIC Domen: 55, 100, 100, 25, 100, 51, 80
    SCHUBERT Jakob: 80, 80, 40, 47, 65, 100, 65, 37
    DESGRANGES Romain: 100, 55, 80, 4, 51, 80, 100, 51
    ONDRA Adam: 51
    ✔ 1 assertion passed
    ✘ Expected: 2
    But was: 3