Skip to content

Expand unit coverage for core records and extension helpers#26

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/analyze-test-coverage
Open

Expand unit coverage for core records and extension helpers#26
Copilot wants to merge 3 commits into
mainfrom
copilot/analyze-test-coverage

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown

Test coverage was thin around foundational value types and extension helpers used by client/server flows. This adds focused unit coverage to close gaps and guard key behaviors.

  • Value types & record behavior
    • Cover Message/Payload/Metadata constructors, flags, and equality
    • Validate record equality for ServerMessage and ErrorOccurred
  • Internal and public extension helpers
    • Exercise Internal.Extensions.Try/Async/GetMetadata and ToPayload encoding
    • Validate client/server observable send/broadcast extension routing via test doubles

Example coverage:

var message = Message.Create("Hello");
Assert.True(message.IsText);
Assert.Equal("Hello", message.ToString());

using var payload = "Hello".AsMemory().ToPayload(Encoding.UTF8, WebSocketMessageType.Text);
Assert.Equal(Encoding.UTF8.GetBytes("Hello"), payload.Data.ToArray());

Copilot AI and others added 2 commits April 20, 2026 08:08
Agent-Logs-Url: https://github.com/st0o0/WebSocket.Rx/sessions/56189ab6-ed22-4f05-b20d-0bb0587286aa

Co-authored-by: st0o0 <64534642+st0o0@users.noreply.github.com>
@st0o0 st0o0 marked this pull request as ready for review April 20, 2026 08:20
@st0o0 st0o0 closed this Apr 20, 2026
@st0o0 st0o0 reopened this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants