M220 - Ticket: User Report

I’m trying to pass “TestGetsTopTwenty()” test.
I have this code:

result = await _commentsCollection
                    .WithReadConcern(ReadConcern.Majority)
                    .Aggregate()
                    .Group(c => c.Email, g => new { Id = g.Key, Count = g.Count() })
                    .SortByDescending(g => g.Count)
                    .Limit(20)
                    .Project(rp => new ReportProjection { Id = rp.Id, Count = rp.Count })
                    .ToListAsync();

I get 277 instead of 331 for “Assert.AreEqual(331, result.Report.First().Count);” assertion.

Can you help me?

Most likely it is the same issue as:

1 Like

I found that the new sample codebase is updated with the correct value as 277 for “result.Report.First().Count”, in my case I am getting error for the last Assert statement which is for “result.Report.Last().Count”, I am getting value as 242 instead of 292.

2 Likes

I also had 242 as the Last().Count which makes sense as it should be less then the First().Count value of 277.

2 Likes

I also had 242 for result.Report.Last().Count