Ad
  • Default User Avatar

    I'm getting the same error (in Java) and am passing the test case in description. Any other hints about what this test case is looking for?

  • Default User Avatar

    No worries! I really didn't think there was anything you could do about it, but I'd thought I'd leave it here, just in case someone else is struggling with the same thing.

    Thanks!

  • Default User Avatar

    No, I've solved it. I'm saying that the arguments passed to the test cases are in the wrong order. The actual result your code produces is listed under the "expected" category, and the expected time is listed under the "saw" category.

    So you have this:
    assertEquals(NthSeries.seriesSum(5), "1.57");

    When it should be:
    assertEquals("1.57", NthSeries.seriesSum(5));

    That's all.

  • Default User Avatar

    Oh, it seemed to have erased part of the error message I copied in:
    When I failed the first test case, I received this message:

    test1(NthSeriesTest)
    expected: 1.[68] but was: 1.57

    This, to me, reads that the test case was expecting 1.68, and my code was producing 1.57; however, it was the other way around: 1.68 is what my code was producing, while 1.57 was what the test case is looking for. So basically I spent a lot of time trying to figure out why my solution was producing 1.68 locally, but failing the test case online... It's just my two cents. Trying to keep others from making my mistakes.

  • Default User Avatar
  • Default User Avatar

    I believe the arguments in the test cases are in the wrong order.
    test1(NthSeriesTest)
    expected:<1.[68]> but was:<1.[57]>
    1.68 is what my code was producing, while 1.57 was what the test case is looking for. Just so you know.

    Also, from the examples, I thought the series was part of the string that was returned "1 + ... = "1.57"", so it took me a long time to figure out why I was failing test cases. Maybe you could make that part a little more clear?

    Otherwise, great kata.