Ad
  • Default User Avatar

    When data input is the following:

    [{"name":"Peter","profession":"teacher","age":20,"maritalStatus":"married"},
    {"name":"Michael","profession":"teacher","age":50,"maritalStatus":"single"},
    {"name":"Peter","profession":"teacher","age":20,"maritalStatus":"married"},
    {"name":"Anna","profession":"scientific","age":20,"maritalStatus":"married"},
    {"name":"Rose","profession":"scientific","age":50,"maritalStatus":"married"},
    {"name":"Anna","profession":"scientific","age":20,"maritalStatus":"single"},
    {"name":"Anna","profession":"politician","age":50,"maritalStatus":"married"}]
    

    Test assertion is the following:

    Test.assertSimilar(query().select(professionCount).from(persons).groupBy(profession).execute(),  [["teacher",3],["scientific",3],["politician",1]]);
    

    I get this test rejection...
    Expected: '[[\'politician\', 1], [\'scientific\', 3], [\'teacher\', 3]]', instead got: '[[\'teacher\', 3], [\'scientific\', 3], [\'politician\', 1]]'

    I don't know what to do :/