<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dotnet on Tokenise</title><link>https://tokenise.rosvetic.com/tags/dotnet/</link><description>Recent content in Dotnet on Tokenise</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Mon, 09 Nov 2026 16:08:00 +0000</lastBuildDate><atom:link href="https://tokenise.rosvetic.com/tags/dotnet/index.xml" rel="self" type="application/rss+xml"/><item><title>Your agent's minimal API accepts anything: turn on .NET 10 validation and test the 400s</title><link>https://tokenise.rosvetic.com/posts/minimal-api-validation-addvalidation-agent-endpoints-csharp/</link><pubDate>Mon, 09 Nov 2026 16:08:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/minimal-api-validation-addvalidation-agent-endpoints-csharp/</guid><description>&lt;p&gt;Ask an agent for a &lt;code&gt;POST /orders&lt;/code&gt; endpoint in ASP.NET Core and the handler it writes will compile, run and return 201 for a body with no customer, a quantity of minus five and a misspelt field. Nothing in the request type says otherwise, so nothing pushes back. The agent has no reason to add checks the prompt never asked for, and the happy-path test it writes alongside passes.&lt;/p&gt;</description></item><item><title>Your agent's tests pass until midnight: inject TimeProvider and ban the system clock</title><link>https://tokenise.rosvetic.com/posts/timeprovider-fake-clock-agent-time-bugs-csharp/</link><pubDate>Mon, 09 Nov 2026 11:08:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/timeprovider-fake-clock-agent-time-bugs-csharp/</guid><description>&lt;p&gt;A typical first draft of a 14-day free trial calls &lt;code&gt;DateTime.UtcNow&lt;/code&gt; in three places. The tests written next call it again, compare against a value computed a few microseconds earlier, and pass. Mostly. They fail when the clock ticks between two lines, when the suite runs just before midnight UTC, or on the one day a month when someone checks the boundary by hand and finds the trial ends a day early.&lt;/p&gt;</description></item><item><title>Make the C# compiler reject an agent's half-finished enum change</title><link>https://tokenise.rosvetic.com/posts/exhaustive-switch-gate-agent-enum-changes-csharp/</link><pubDate>Mon, 09 Nov 2026 07:05:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/exhaustive-switch-gate-agent-enum-changes-csharp/</guid><description>&lt;p&gt;The ticket says orders can now be refunded. An agent adds &lt;code&gt;Refunded&lt;/code&gt; to the &lt;code&gt;OrderStatus&lt;/code&gt; enum, wires up the refund endpoint, runs the tests, sees green and opens the pull request. Eleven switch expressions elsewhere in the codebase still decide what each status means: whether the order can be cancelled, which email goes out, what the dashboard shows, which rows the nightly export includes. Nobody changed them. Nothing failed.&lt;/p&gt;</description></item></channel></rss>