User Report Ticket, CommentRepsitoryTest --> TestsGetsTopTwent Unittest


I think this unit test is wrong. Can you check please?

Assert.AreEqual(277, result.Report.First().Count);
Assert.AreEqual(292, result.Report.Last().Count);

When i aggregate comments collection in the mongodb compass my first item(item is users email) count ise 277 and last item is 242. The first item is matching but last item is not. By the way we are sorting comment by descending. In that situation t should not be possible that last item count is greater than the first item. That’s why, i think the unit test should be belown.

Assert.AreEqual(242, result.Report.Last().Count);

Best regards…

1 Like

Hi @Emre_Polat, welcome to the community. :wave:

That’s not the correct test function.
Can you please delete the current version of the application and download the course handouts again to refresh this function?

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,