< Summary - Syki

Information
Class: Syki.Back.Features.Notifications.GetUnreadNotificationsCount.GetUnreadNotificationsCountService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Notifications/GetUnreadNotificationsCount/GetUnreadNotificationsCountService.cs
Tag: 97_27801654829
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 12
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Get()100%210%

File(s)

/home/runner/work/syki/syki/Back/Features/Notifications/GetUnreadNotificationsCount/GetUnreadNotificationsCountService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Notifications.GetUnreadNotificationsCount;
 2
 03public class GetUnreadNotificationsCountService(SykiDbContext ctx) : ISykiService
 4{
 5    public async Task<GetUnreadNotificationsCountOut> Get()
 6    {
 07        var count = await ctx.UserNotifications.CountAsync(x =>
 08            x.UserId == ctx.RequestUser.Id && x.ViewedAt == null);
 9
 010        return new GetUnreadNotificationsCountOut { Count = count };
 011    }
 12}