Precept.Core
The core of the Precept test framework: test attributes, the ambient test context, settings, outcome exceptions and the assertion engine.
dotnet add package Precept.Core
Most projects should not reference this package directly. Install
Precept.TestPlatform instead. It brings Precept.Core with it
and adds the runner. Reference Core on its own only for a library of shared step definitions or
helpers that must not depend on the runner, or for a reporter of your own.
Everything a test sees lives in the root Precept namespace, so a step definition needs no extra
using:
await Assert.That(order.Total).ToBeEqualAsync(42.00m);
await Assert.That(basket.Items).Not.ToBeEmptyAsync();
await Assert.Eventually(() => Db.ScalarAsync<long>("select count(*) from outbox where sent = 0"))
.Within(TimeSpan.FromMinutes(2))
.ToBeEqualAsync(0L);
Every assertion is awaited. An assertion over a value in hand completes at once, but the same sentence also covers an element that is not on the page yet and a job that finishes eventually, so the waiting lives inside the assertion rather than in a sleep in front of it.
Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: assertions · writing your own · configuration · dependency injection · writing a reporter