< Summary

Information
Class: NostrSure.Domain.Entities.Relay
Assembly: NostrSure.Domain
File(s): /home/runner/work/NostrSure/NostrSure/NostrSure.Domain/Entities/Relay.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 17
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Endpoint()100%11100%
.ctor(...)100%1010100%

File(s)

/home/runner/work/NostrSure/NostrSure/NostrSure.Domain/Entities/Relay.cs

#LineLine coverage
 1namespace NostrSure.Domain.Entities;
 2
 3public sealed class Relay
 4{
 25    public Uri Endpoint { get; }
 56    public Relay(string endpoint)
 57    {
 58        if (!Uri.TryCreate(endpoint, UriKind.Absolute, out var uri))
 29            throw new ArgumentException("Invalid relay endpoint.", nameof(endpoint));
 10
 11        // Validate that the scheme is appropriate for a relay
 312        if (uri.Scheme != "ws" && uri.Scheme != "wss" && uri.Scheme != "http" && uri.Scheme != "https")
 113            throw new ArgumentException("Relay endpoint must use ws://, wss://, http://, or https:// scheme.", nameof(en
 14
 215        Endpoint = uri;
 216    }
 17}