PolyType.TestCases
v2.0.0-rc.3Latest Pre-release
net10.0net11.0.NETStandard2.0
Practical generic programming for C#
Published
Oct 27, 2026
6d ago
Total Downloads
38.0K
38,031
Install
dotnet add package PolyType.TestCases --version 2.0.0-rc.3
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
PolyType consumer test cases
This package is intended for consumption by your unit test project. It presents a bunch of types that help to exhaustively test your PolyType visitors.
[Theory]
[MemberData(nameof(TestTypes.GetTestCases), MemberType = typeof(TestTypes))]
public void Roundtrip_Value<T, TProvider>(TestCase<T, TProvider> testCase)
where TProvider : IShapeable<T>
{
T value = testCase.Value;
Type type = testCase.Type;
ITypeShape<T> shape = testCase.DefaultShape;
// Exercise your code using these values...
}
There are other properties on the test case that may be helpful in knowing whether you can perform certain operations on the test case with an expectation of success.
Changes from Previous Version
No structural changes between v2.0.0-rc.2 and v2.0.0-rc.3.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.