< Summary

Information
Class: NostrSure.Infrastructure.Client.Implementation.ClientWebSocketWrapper
Assembly: NostrSure.Infrastructure
File(s): /home/runner/work/NostrSure/NostrSure/NostrSure.Infrastructure/Client/Implementation/ClientWebSocketWrapper.cs
Line coverage
28%
Covered lines: 4
Uncovered lines: 10
Coverable lines: 14
Total lines: 34
Line coverage: 28.5%
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(...)50%22100%
get_State()100%210%
ConnectAsync(...)100%210%
CloseAsync(...)100%210%
Dispose()100%210%

File(s)

/home/runner/work/NostrSure/NostrSure/NostrSure.Infrastructure/Client/Implementation/ClientWebSocketWrapper.cs

#LineLine coverage
 1using System.Net.WebSockets;
 2using NostrSure.Infrastructure.Client.Abstractions;
 3
 4namespace NostrSure.Infrastructure.Client.Implementation;
 5
 6/// <summary>
 7/// Wrapper for ClientWebSocket to implement IClientWebSocket
 8/// </summary>
 9public sealed class ClientWebSocketWrapper : IClientWebSocket
 10{
 11    private readonly ClientWebSocket _webSocket;
 12
 113    public ClientWebSocketWrapper(ClientWebSocket webSocket)
 114    {
 115        _webSocket = webSocket ?? throw new ArgumentNullException(nameof(webSocket));
 116    }
 17
 018    public WebSocketState State => _webSocket.State;
 19
 20    public Task ConnectAsync(Uri uri, CancellationToken cancellationToken)
 021    {
 022        return _webSocket.ConnectAsync(uri, cancellationToken);
 023    }
 24
 25    public Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationTo
 026    {
 027        return _webSocket.CloseAsync(closeStatus, statusDescription, cancellationToken);
 028    }
 29
 30    public void Dispose()
 031    {
 032        _webSocket.Dispose();
 033    }
 34}