agui-dotnet-unit-tests
Skill16k starsChanged 9 months agoMITView on GitHub
Author unit tests for the AG-UI .NET SDK (the *.UnitTests projects), following the SDK's serialization and compatibility conventions. USE FOR: adding unit-test coverage for a new type/method in AGUI.Abstractions/Formatting/Protobuf/Client/Server, event serialization round-trips, JsonDocument property-name assertions, backward-compatibility fixtures against TypeScript JSON, protobuf codec round-trips, client builder/handler tests, server ChatResponseUpdate conversion tests, SSE formatter tests. DO NOT USE FOR: HTTP pipeline / WebApplicationFactory end-to-end tests (use the agui-dotnet-integration-tests skill), cross-language TS↔C# server-parity tests (use the cross-language test skill).
Trending
More talk lately.about the whole repository
Who's talking about ag-ui-protocol/ag-ui
- strands-agents/harness-sdk“[FEATURE] AG-UI”GitHub · May 29, 2025 · 44 reactions
- A Hacker News story“Show HN: AG-UI Protocol – Bring Agents into Frontend Applications”Hacker News · May 13, 2025 · 36 points
- NousResearch/hermes-agent“Feature: Web UI Gateway — Local Browser-Based Interface with Streaming, Artifacts & Rich Rendering”GitHub · Mar 6, 2026 · 10 reactions
- langchain-ai/deepagents“AG-UI integration/demo”GitHub · Nov 5, 2025 · 8 reactions
- Effect-TS/effect“Feature request: AG-UI protocol support for effect/ai”GitHub · Jun 15, 2026 · 7 reactions
The biggest 5 of 56 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 56
Talked about on GitHub, Bluesky and Hacker News (56 times).
On GitHub · 50
- May 29, 2025[FEATURE] AG-UI — strands-agents/harness-sdk44 reactions · 4 comments
- Mar 6, 2026Feature: Web UI Gateway — Local Browser-Based Interface with Streaming, Artifacts & Rich Rendering — NousResearch/hermes-agent10 reactions · 15 comments
- Nov 5, 2025AG-UI integration/demo — langchain-ai/deepagents8 reactions · 5 comments
- Jun 15, 2026Feature request: AG-UI protocol support for effect/ai — Effect-TS/effect7 reactions
- Aug 22, 2025Feature Request: Add AG-UI Protocol Support — HolmesGPT/holmesgpt7 reactions · 5 comments
45 more on GitHub
- Aug 12, 2026Make Copilot SDK consumable for end-users by adding first-class AG-UI protocol support — github/copilot-sdk5 reactions
- Apr 10, 2026FR : Integrations with the A2UI and AG‑UI Protocols — Chainlit/chainlit4 reactions · 2 comments
- Jun 27, 2025support agui protocol — langgenius/dify4 reactions · 3 comments
- Sep 14, 2026IPI-1211 · PLANNER-RELIABILITY — Upgrade the Mastra Bridge to 1.1.4 Before Re-Testing Intelligence — amoai-tech/ipixaisays it tested it3 reactions · 11 comments
- Aug 17, 2026[Question / Feature Request] Any plans or built-in support for AG-UI protocol integration? — google/adk-go3 reactions · 2 comments
- Sep 27, 2026IPI-1363 · Prevent malformed workspace context from crashing the Planner — amoai-tech/ipixai2 reactions · 6 comments
- Sep 20, 2026IPI-1259 · Show a visible Production Copilot error when an AI run drops — amoai-tech/ipixai2 reactions · 14 comments
- Jul 22, 2026fix(deps): bump @ag-ui/mastra to stable, prevent HITL interrupt strand (IPI-760) — amo-tech-ai/lumina-studio2 reactions · 14 comments
- Nov 16, 2025docs: pluralize add_langgraph_fastapi_endpoint due to ag-ui-protocol/ag-ui/pull/701 — CopilotKit/CopilotKit2 reactions · 4 comments
- Oct 17, 2025🚀 Feature Request: Agno shared state as adk-middleware — CopilotKit/CopilotKit2 reactions · 2 comments
- Jun 30, 2025feat: AG-UI adapter (toolsets) — pydantic/pydantic-ai2 reactions · 6 comments
- Nov 1, 2026chore(deps): bump @ag-ui/core from 1.0.2 to 1.0.3 — dungsil/keundal1 reaction · 1 comment
- Aug 31, 2026Bump jsondiffpatch, @ag-ui/mastra and @mastra/client-js — ovabor/worksync-frontend1 reaction · 2 comments
- Aug 20, 2026Tracking: our upstream comments on A2A #1992 and AG-UI #2148 — hukaichun/funduq1 reaction · 1 comment
- Apr 10, 2026🐛 Bug: [sdk-python] Intermediate messages from subgraphs appear in final MessagesSnapshotEvent — CopilotKit/CopilotKit1 reaction · 2 comments
- Mar 15, 2026Ensure glasses client is written correctly and perform gap analysis of design document and implement missing features — companionintelligence/CI-Mentra1 reaction
- Feb 22, 2026[FEAT] add Agno (AgnoOS) as a supported agent provider — tambo-ai/tambo1 reaction · 1 comment
- Oct 7, 2025为BotSharp添加AGUI兼容插件 — GreenShadeZhang/BotSharp1 reaction
- Jul 25, 2025https://github.com/ag-ui-protocol/ag-ui — mikkihugo/claude-code-zen1 reaction
- Jun 23, 2025[FEAT] Support AGUI — VoltAgent/voltagent1 reaction · 5 comments
- May 25, 2025AG-UI — mudler/LocalAGI1 reaction
- Nov 2, 2026chore(deps): bump the ag-ui-updates group across 1 directory with 2 updates — 46ki75/elmethis0 reactions
- Nov 2, 2026Bump @ag-ui/client from 0.0.59 to 1.0.3 — govuk-once/govuk-chat-v20 reactions
- Nov 1, 2026Bump zod and @ag-ui/core in /chatbot-app/frontend — aws-samples/sample-reconciliation-agent0 reactions
- Nov 1, 2026Bump @ag-ui/client from 0.0.59 to 1.0.1 in /web — cfokit/cfokit0 reactions · 1 comment
- Oct 24, 2026Bump @ag-ui/client from 1.0.2 to 1.0.3 in /extensions/conversationalbi/runtime — sanderdw/iceberg-data-platform0 reactions
- Oct 23, 2026DEV: Bump @ag-ui/client from 0.0.59 to 1.0.3 in /architect-html — origam/origam0 reactions
- Oct 22, 2026[TASK] Progressive A2UI over AG-UI via a render_a2ui system tool — yaalalabs/agent-kernel0 reactions
- Oct 20, 2026chore: bump @ag-ui/client from 0.0.59 to 1.0.3 — 46ki75/internal0 reactions · 1 comment
- Oct 19, 2026build(deps): bump @ag-ui/client from 1.0.2 to 1.0.3 in /harness/web — roboalchemist/kicad-agent0 reactions
- Oct 15, 2026deps: bump @ag-ui/client from 0.0.59 to 1.0.2 — d2k-klin/reelhive0 reactions · 1 comment
- Oct 15, 2026deps: bump ag-ui-protocol from 0.1.22 to 1.0.0 — d2k-klin/reelhive0 reactions · 1 comment
- Oct 12, 2026Bump @ag-ui/client from 0.0.59 to 1.0.2 in /apps/portal — ovsec/agent-platform0 reactions
- Oct 11, 2026chore(deps): bump @ag-ui/client from 0.0.59 to 1.0.2 in /apps/admin — karthictu/casepilot0 reactions
- Oct 9, 2026build(deps): Bump @ag-ui/client from 0.0.59 to 1.0.2 in /src/web — devkimchi/battle-school-lunch0 reactions
- Oct 8, 2026ag-ui — hmafridy1-sketch/Hemel0 reactions
- Oct 5, 2026chore(deps): Bump @ag-ui/core from 0.0.57 to 1.0.1 in /server — dineshreddymeka/Agent-Marko0 reactions · 1 comment
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/form-agent — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/rag-agent — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/assistant — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026chore(deps): bump @ag-ui/core from 1.0.0 to 1.0.1 — c10366956/cyrene-cda0 reactions
- Oct 2, 2026Bump ag-ui-protocol from 0.1.19 to 1.0.0 — sidhasadhak/aughor0 reactions
- Sep 29, 2026chore(deps): bump @ag-ui/client from 0.0.59 to 1.0.2 in /chatbot-app/frontend — aws-samples/sample-strands-agent-with-agentcore0 reactions
- Sep 29, 2026chore(deps): bump @ag-ui/core from 0.0.59 to 1.0.2 in /chatbot-app/frontend — aws-samples/sample-strands-agent-with-agentcore0 reactions
- Sep 28, 2026build(deps): bump ag-ui-protocol from 0.1.22 to 1.0.0 — srtab/daiv0 reactions
On Bluesky · 5
- Aug 6, 2025with the emergence of early MCP-UI and AG-UI standards, the 2013 perspective of "cards are the future of the web" is set to ring true for a… — @ronan.design3 likes and reposts · 1 reply
- Oct 2, 2026📦 ag-ui-protocol / ag-ui ⭐ 16,187 (+68) 🗒 TypeScript AG-UI: the Agent-User Interaction Protocol. Bring Agents into Frontend Applications. — @github-trending-js.bsky.social1 likes and repost
- Jul 29, 2026📦 ag-ui-protocol / ag-ui ⭐ 15,003 (+48) 🗒 TypeScript AG-UI: the Agent-User Interaction Protocol. Bring Agents into Frontend Applications. — @github-trending-js.bsky.social1 likes and repost
- Jul 22, 2026github.com/ag-ui-protoc... [Related post:https://javapro.io/2026/07/16/solving-spring-ais-ui-challenge-with-ag-uis-java-sdk/] << ...open,… — @stefanofago.bsky.social1 likes and repost
- May 14, 2025github.com/ag-ui-protoc... — @detroitpro.bsky.social1 likes and repost
On Hacker News · 1
- May 13, 2025Show HN: AG-UI Protocol – Bring Agents into Frontend Applications36 points · 5 comments
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agui-cross-sdk-paritySkill
- agui-dojoSkill
- agui-dotnet-agents-syncSkill
- agui-dotnet-code-reviewSkill
- agui-dotnet-cross-language-testsSkill
- agui-dotnet-feature-workflowSkill
- agui-dotnet-integration-testsSkill
- agui-dotnet-sample-stepSkill
- agui-dotnet-sdk-docsSkill
- agui-dotnet-transportSkill
- agui-dotnet-wire-typesSkill
- agui-playwright-validateSkill
- ag-ui-a2ui-integrationSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
All commands run from sdks/dotnet/.
- Very specific: line 34
Run one project: dotnet test tests/AGUI.Abstractions.UnitTests/
- Very specific: line 38
Test files live directly under the project root (not mirrored into Events/ subfolders).
- Very specific: line 40
Test class name: {TypeUnderTest}Test (RunStartedEventTest, ToolCallBuilderTest).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AG-UI .NET Unit Tests
Conventions for the tests/*.UnitTests projects. Mined from sdks/dotnet/AGENTS.md
and existing tests. An agent gets these wrong by default: asserting on deserialized
objects (misses naming bugs), comparing full JSON strings (fragile), using reflection,
or skipping the FixtureLoader compatibility pattern.
All commands run from sdks/dotnet/.
Unit-test projects
| Project | Focus |
tests/AGUI.Abstractions.UnitTests/ | Event serialization round-trips; backward compat vs TypeScript fixtures (Compatibility/) |
tests/AGUI.Protobuf.UnitTests/ | Protobuf codec round-trips; JsonElement↔protobuf Value conversion |
tests/AGUI.Client.UnitTests/ | Client builders, content-negotiation handler, transport, protocol rules |
tests/AGUI.Server.UnitTests/ | ChatResponseUpdate → AG-UI event conversion |
tests/AGUI.Formatting.UnitTests/ | SSE event-stream formatter (read/write, media type) |
Run one project: dotnet test tests/AGUI.Abstractions.UnitTests/
Conventions
- Test files live directly under the project root (not mirrored into
Events/subfolders). Compatibility tests go in theCompatibility/subfolder. - Test class name:
{TypeUnderTest}Test(RunStartedEventTest,ToolCallBuilderTest). Compatibility class:{Category}CompatibilityTest(RunEventsCompatibilityTest). public sealed class, one class per file, file name matches type.[Fact]for single cases,[Theory]+[InlineData]for parameterized cases.- Serialize via the source-generated context:
AGUIJsonSerializerContext.Default.{Type}— neverJsonSerializer.Serialize<object>(...)or hand-rolled options.
Pattern 1 — Event serialization round-trip (Abstractions)
Serialize via the source-gen context, parse with JsonDocument, assert each camelCase
property name AND the type discriminator. This is what catches [JsonPropertyName] bugs.
[Fact]
public void Serialization_RoundTrips()
{
var evt = new RunStartedEvent { ThreadId = "t1", RunId = "r1", Timestamp = 1234567890 };
var json = JsonSerializer.Serialize(evt, AGUIJsonSerializerContext.Default.RunStartedEvent);
using var doc = JsonDocument.Parse(json);
Assert.Equal("RUN_STARTED", doc.RootElement.GetProperty("type").GetString());
Assert.Equal("t1", doc.RootElement.GetProperty("threadId").GetString());
Assert.Equal("r1", doc.RootElement.GetProperty("runId").GetString());
Assert.Equal(1234567890, doc.RootElement.GetProperty("timestamp").GetInt64());
}Pattern 2 — Backward-compatibility fixtures (Abstractions/Compatibility)
Compatibility/Fixtures/*.json are produced by the TypeScript reference implementation.
Deserialize them into .NET types and assert the values — this catches wire-format drift.
Load arrays with FixtureLoader; write one test method per event shape.
public sealed class RunEventsCompatibilityTest
{
private readonly JsonElement[] _fixtures = FixtureLoader.LoadFixture("run-events.json");
[Fact]
public void RunStartedEvent_DeserializesFromTypeScriptPayload()
{
var evt = FixtureLoader.DeserializeAsBaseEvent(_fixtures[0]);
var typed = Assert.IsType<RunStartedEvent>(evt);
Assert.Equal("thread-1234", typed.ThreadId);
Assert.Equal("run-5678", typed.RunId);
}
}Adding a fixture: place the TS-produced JSON array under Compatibility/Fixtures/
(embedded resource), then index into the loaded array per shape.
Pattern 3 — Protobuf codec round-trip (Protobuf)
Encode→decode and assert typed values. Compare JsonElement payloads with
JsonTestHelpers.AssertEqual (deep-equals), not string compare. ProtoValueConverter
tests verify JsonElement↔Value for each ValueKind.
var result = RoundTrip(new RunStartedEvent { ThreadId = "thread-1", RunId = "run-1" });
Assert.Equal("thread-1", result.ThreadId);
JsonTestHelpers.AssertEqual(expectedElement, result.RawEvent!.Value);Pattern 4 — Client builders / handler (Client)
Drive the builder/handler through its real API and assert the produced MEAI types.
ToolCallBuilder/TextMessageBuilder: feed events, flush, assert FunctionCallContent,
ConversationId, ResponseId. AGUIEventStreamHandler: assert content-negotiation
Accept header ordering via a test inner handler. Standard xunit assertions.
Pattern 5 — Server conversion (Server)
Convert a ChatResponseUpdate stream to AG-UI events and assert the sequence with
Assert.Collection, type-checking each event and its fields (e.g. run lifecycle wraps
content with RunStartedEvent/RunFinishedEvent).
Pattern 6 — SSE formatter (Formatting)
Assert MediaType, CanRead(contentType) (use [Theory]/[InlineData] for case and
null/empty handling), and that WriteAsync produces the data: {json} shape per event.
❌ Critical anti-patterns
- Never assert only on the deserialized object for serialization tests. Round-trip
through your own type hides
[JsonPropertyName]mistakes. Parse the JSON withJsonDocumentand assert the literal camelCase property names +typediscriminator. - Never compare full JSON strings — fragile against property ordering/whitespace.
Parse and check individual properties (or
JsonTestHelpers.AssertEqualfor payloads). - Never use reflection to enumerate types or verify membership. Write explicit per-type / per-shape tests.
- Never use ad-hoc serializer options. Serialize through
AGUIJsonSerializerContext.Default.{Type}so tests exercise the real AOT context. - Never collapse compatibility shapes into one loop-only assertion. Keep one test method per event shape so a drift failure names the exact event.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

