Skip to main content

Extension packages

Expectations for types outside the base class library are provided by separate packages. Each package adds extension methods on IThat<T> for its types, so once it is referenced, its expectations appear on Expect.That(…) next to the built-in ones.

PackageExpectations
aweXpect.JsonJSON strings and JsonElement: IsEqualTo(…).AsJson(), IsValidJson, Matches, IsObject, IsArray, IsJsonSerializable
aweXpect.WebHttpRequestMessage and HttpResponseMessage: HasMethod, HasRequestUri, HasStatusCode, HasHeader, HasContent
aweXpect.Reflectionassemblies, types and members, for architecture and convention tests
aweXpect.Testablythe file and time systems of Testably.Abstractions: HasFile, HasDirectory, timers, watcher events
aweXpect.Mockolateinteractions with Mockolate mocks: Once, Never, AtLeast, Then, AllInteractionsAreVerified

Write your own​

If no package covers your types, you can add expectations yourself with the same API these packages use. Extending aweXpect walks you through your first expectation and the conventions for its failure messages.