< Summary - Estud

Information
Class: Estud.Back.Domain.Webhooks.WebhookSubscription
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Domain/Webhooks/WebhookSubscription.cs
Tag: 114_29044117136
Line coverage
96%
Covered lines: 24
Uncovered lines: 1
Coverable lines: 25
Total lines: 44
Line coverage: 96%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_InstitutionId()100%11100%
get_Name()100%11100%
get_Url()100%11100%
get_IsActive()100%11100%
get_CreatedAt()100%11100%
get_Events()100%11100%
get_Calls()100%210%
get_CustomHeaders()100%11100%
.ctor()100%11100%
.ctor(...)50%22100%
Update(...)50%22100%

File(s)

/home/runner/work/syki/syki/Back/Domain/Webhooks/WebhookSubscription.cs

#LineLine coverage
 1namespace Estud.Back.Domain.Webhooks;
 2
 3/// <summary>
 4/// Inscrição de Webhook para receber notificações sobre eventos acadêmicos.
 5/// </summary>
 6public class WebhookSubscription
 7{
 348    public int Id { get; set; }
 249    public int InstitutionId { get; set; }
 3410    public string Name { get; set; }
 3411    public string Url { get; set; }
 3412    public bool IsActive { get; set; }
 3213    public DateTime CreatedAt { get; set; }
 14
 3415    public List<WebhookEventType> Events { get; set; }
 016    public List<WebhookCall> Calls { get; set; }
 17
 18    /// <summary>
 19    /// Headers customizados enviados em todas as chamadas feitas para a Url do Webhook.
 20    /// </summary>
 6821    public Dictionary<string, string> CustomHeaders { get; set; } = [];
 22
 2023    private WebhookSubscription() { }
 24
 2425    public WebhookSubscription(int institutionId, string name, string url, List<WebhookEventType> events, Dictionary<str
 26    {
 2427        InstitutionId = institutionId;
 2428        Name = name;
 2429        Url = url;
 2430        Events = events;
 2431        CustomHeaders = customHeaders ?? [];
 2432        IsActive = true;
 2433        CreatedAt = DateTime.UtcNow;
 2434    }
 35
 36    public void Update(string name, string url, List<WebhookEventType> events, Dictionary<string, string> customHeaders,
 37    {
 238        Name = name;
 239        Url = url;
 240        Events = events;
 241        CustomHeaders = customHeaders ?? [];
 242        IsActive = isActive;
 243    }
 44}