Table of Contents

Class SseFormat

Namespace
SseAssertions
Assembly
SseAssertions.dll

Framework-agnostic primitives over Server-Sent Events streams. v0.0.1 ships the LooksLikeServerSentEvents(string) discriminator only; the full frame parser and per-frame JSON-payload deserialization helpers ship in v0.1.0.

public static class SseFormat
Inheritance
SseFormat
Inherited Members

Methods

LooksLikeServerSentEvents(string)

Lightweight discriminator that returns true when body has the textual shape of a Server-Sent Events stream: at least one SSE field line (a line beginning with event:, data:, id:, or retry:) followed by the double-newline frame separator. Returns false for arbitrary strings, empty input, or text that contains no SSE field markers.

public static bool LooksLikeServerSentEvents(string body)

Parameters

body string

The text to inspect.

Returns

bool

true if the input has the shape of an SSE stream; otherwise false.

Remarks

The check is intentionally cheap and forgiving: it does not parse the stream, validate the encoding, or enforce field ordering. Its purpose is to give a test assertion a fast "is this the right ballpark" signal before a structured-parse assertion shipped in a later release walks the actual frames.

Exceptions

ArgumentNullException

body is null.