< Summary - Syki

Information
Class: Syki.Back.Features.Academic.GetWebhookSubscription.GetWebhookSubscriptionService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/GetWebhookSubscription/GetWebhookSubscriptionService.cs
Tag: 21_17346963026
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 18
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Get()50%22100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/GetWebhookSubscription/GetWebhookSubscriptionService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Academic.GetWebhookSubscription;
 2
 23public class GetWebhookSubscriptionService(SykiDbContext ctx) : IAcademicService
 4{
 5    public async Task<OneOf<GetWebhookSubscriptionOut, SykiError>> Get(Guid institutionId, Guid id)
 6    {
 27        var webhook = await ctx.Webhooks.AsNoTracking()
 28            .Include(w => w.Calls)
 29            .Include(w => w.Authentication)
 210            .Where(w => w.InstitutionId == institutionId && w.Id == id)
 211            .OrderByDescending(c => c.CreatedAt)
 212            .FirstOrDefaultAsync();
 13
 214        if (webhook == null) return new WebhookNotFound();
 15
 216        return webhook.ToGetWebhookSubscriptionOut();
 217    }
 18}