Testing
28 pages.
A `[Test]` answers an outbound call from a stub — `Http.<Verb>.Stub(url => …)` — or, when the test says so with `[AllowNetwork("host")]`, makes it…
`<Function>.Stub(λ)` makes one of the app's own functions answer a value, or throw, for the rest of a `[Test]` — wherever it is called from: the test…
A test in Osy# is not a unit test with the world mocked out. It is your app, running against its own throwaway database, with your security rules…
`TestEmbedder.Use(embedder)` makes a test run embed with an embedder written in Osy# — any class implementing `Osysharp.Memory.IEmbedder` — so a…
The assertions a test makes. Beyond the usual equality and null checks there are comparisons (Greater, Less, InRange), a regex check (Matches)…
The erasure oracle: the token is found nowhere the app keeps data — any column of any table (the audit trail, memory, outboxes, translations and the…
`Mcp.*` opens a REAL MCP session against a tool catalog your own app publishes with `app.McpServer`, from inside a `[Test]`, and returns what it…
`Api.*` sends a real HTTP request to a route your own app publishes with `app.Apis`, from inside a `[Test]`, and returns what came back —…
What a test's unit of work sent to the database between two points: take a mark, do the thing, read what it cost — in the numbers a plan's limits…
Debugs one of your app's tests against a Platform on your own machine — breakpoints, stepping, and variable inspection in your editor — with no…
Mark a [TestFixture] with [DevSeed("label")] and the local dev page (`osy launch --dev`) offers it as a button that loads that fixture's world into…
A [TestFixture] is built once per run, and every test that names it runs on its own copy of what it left — rows, files and clock. A fixture may build…
Runs one test and, pass or fail, keeps the world it built serving on your machine — its data and its app version — and opens it in your browser…
Every other assertion is about TEXT or STATE, and all of them pass on a screen that is visually broken: a control can be on the page, enabled…
Runs your app's tests against a throwaway copy of its database, reporting each test as it finishes. Your local source is what runs, so you never have…
Runs your app's tests against a Platform on your own machine — no account, no network, no setup beyond a running local platform. `osyrin dev` starts…
In a test, moves the run's clock FORWARD by a duration, then lets the next Workflow.Settle fire every workflow timer the jump made due — reminders…
A theme was write-only — Theme.Toggle and Theme.Set are both writes, and a token identifier is compile-time style material that never becomes a value…
Drive the real UI from a test: navigate to a route, click what a person would click, and assert on what the screen shows. `Ui.*` does things…
In a UI test, keeps the server's answers to the page's reads back until `Ui.ReleaseServer()`, so the test can stand on the screen a slow server…
In a UI test, fires every `on every` clock armed on the screen once, now, and waits for their bodies — server calls included — so a test can assert…
Answers a link minted by `<Slot>.CallbackUrl()` the way the third party holding it would — anonymously, with no principal of any kind. It is the only…
Test-only. Workflow.Settle(row) runs that row's workflow until it has nothing left to do now: due timers, reminders, an expired state or deadline…
A test calls no other machine unless it says so. An outbound call with no stub — `Http.*`, a typed client built on it, an SMTP send — is REFUSED when…
A test is an ordinary function marked [Test]. It runs against a throwaway clone of the app, so it may create rows and break rules freely. A…
A test runs deny-all as an anonymous principal, so to read or write real data it must act AS a seeded `[Principal]`. Declare a named selector with…
One line in any `.test.osy` file opts the whole project into a pinned test clock: every test and every fixture then starts at that instant instead of…
Runs a block as a given principal, so security rules apply exactly as they would for that user. It is how you test that a rule denies the people it…