ShapeShift.Conformance 0.1.1068-alpha

This is a prerelease version of ShapeShift.Conformance.
dotnet add package ShapeShift.Conformance --version 0.1.1068-alpha
                    
NuGet\Install-Package ShapeShift.Conformance -Version 0.1.1068-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ShapeShift.Conformance" Version="0.1.1068-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShapeShift.Conformance" Version="0.1.1068-alpha" />
                    
Directory.Packages.props
<PackageReference Include="ShapeShift.Conformance" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ShapeShift.Conformance --version 0.1.1068-alpha
                    
#r "nuget: ShapeShift.Conformance, 0.1.1068-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ShapeShift.Conformance@0.1.1068-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ShapeShift.Conformance&version=0.1.1068-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ShapeShift.Conformance&version=0.1.1068-alpha&prerelease
                    
Install as a Cake Tool

ShapeShift.Conformance

A conformance kit for authors of third-party ShapeShift format packages.

Features

  • Verifies an IEncoder/IDecoder pair against the contracts that ShapeShift's format-agnostic converter layer relies on: token semantics, the consume-on-true TryReadNull contract, container/end-token state rules, Skip and ShapeShiftPath traversal, every primitive width, binary and dynamic values, malformed and truncated input, security limits, and converter interactions.
  • No test framework dependency. The suite is a list of named, runnable test cases, so it drops into TUnit, xUnit, NUnit, MSTest, or a console app.
  • Capability-driven: a format declares what it can represent and inapplicable cases report themselves as skipped instead of failing.
  • Extensible: add your own format-specific cases through the same collector the built-in suites use.

Usage

public sealed class MyFormatConformanceAdapter
    : FormatConformanceAdapter<MyEncoder, MyDecoder>
{
    public override string FormatName => "MyFormat";

    public override ShapeShiftSerializer<MyEncoder, MyDecoder> CreateSerializer() => new MySerializer();

    public override byte[] Encode(EncodeAction<MyEncoder> action)
    {
        ArrayBufferWriter<byte> buffer = new();
        MyEncoder encoder = new(buffer);
        action(ref encoder);
        encoder.Flush();
        return buffer.WrittenSpan.ToArray();
    }

    public override TResult Decode<TResult>(ReadOnlyMemory<byte> payload, DecodeFunc<MyDecoder, TResult> func)
    {
        MyDecoder decoder = new(payload.Span);
        return func(ref decoder);
    }
}
[Test]
[MethodDataSource(nameof(Cases))]
public void Conformance(ConformanceTestCase testCase) => testCase.Run();

public static IEnumerable<Func<ConformanceTestCase>> Cases() =>
    ConformanceSuite.CreateTestCases(new MyFormatConformanceAdapter())
        .Select(c => (Func<ConformanceTestCase>)(() => c));

See the format authoring guide (docfx/docs/format-authoring.md) for the full contract that these tests enforce, and samples/ubjson for a complete third-party format package that runs this kit.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1068-alpha 36 9/2/2026
0.1.1049-alpha 39 9/1/2026