SharpClaw.ModuleSDK.Testing 0.5.0-dev.20260919.3

This is a prerelease version of SharpClaw.ModuleSDK.Testing.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package SharpClaw.ModuleSDK.Testing --version 0.5.0-dev.20260919.3
                    
NuGet\Install-Package SharpClaw.ModuleSDK.Testing -Version 0.5.0-dev.20260919.3
                    
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="SharpClaw.ModuleSDK.Testing" Version="0.5.0-dev.20260919.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpClaw.ModuleSDK.Testing" Version="0.5.0-dev.20260919.3" />
                    
Directory.Packages.props
<PackageReference Include="SharpClaw.ModuleSDK.Testing" />
                    
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 SharpClaw.ModuleSDK.Testing --version 0.5.0-dev.20260919.3
                    
#r "nuget: SharpClaw.ModuleSDK.Testing, 0.5.0-dev.20260919.3"
                    
#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 SharpClaw.ModuleSDK.Testing@0.5.0-dev.20260919.3
                    
#: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=SharpClaw.ModuleSDK.Testing&version=0.5.0-dev.20260919.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SharpClaw.ModuleSDK.Testing&version=0.5.0-dev.20260919.3&prerelease
                    
Install as a Cake Tool

SharpClaw.ModuleSDK.Testing

SharpClaw.ModuleSDK.Testing compiles real package registrations and runs their behavior through the production SharpClaw.Core graph. It keeps scope validation, effect grants, sensitive approvals, outcome rules, cancellation, and handler disposal active.

Build a Test Host

Pass the real package.json path when package metadata is part of the test. The builder uses PackageManifestLoader and compiles the manifest host mode. The builder rejects an absent or unsupported hostMode.

await using var host = new SharpClawModuleTestBuilder()
    .ConfigureServices(services => services.AddSingleton(testCapture))
    .AddRegistration(new SampleAuthorizationModule(), manifestPath)
    .ApproveSensitiveContributions("sample_authorization")
    .UseExecutionContext(caller, features)
    .Build();

Execution Methods

Method Use
Action(...).WithTerminal(...) Test a package hook around a host-owned terminal.
ActionEntry(...) Test the package-owned registered terminal.
Event(...) Dispatch an event through the compiled Core graph.
InvokeToolAsync(...) Invoke a tool with caller, feature, and conversation authority.
InvokeCliAsync(...) Resolve and invoke one scoped CLI handler.
InvokeHttpAsync(...) Resolve and invoke one scoped HTTP handler.
InvokeWebSocketAsync(...) Resolve and invoke one scoped WebSocket handler.
InScopeAsync(...) Resolve package services in a bounded asynchronous scope.
StartAsync and StopAsync Test lifecycle behavior through Core lifecycle actions.

ActionEntry requires one matching action definition and one matching terminal registration. Each application method also requires one exact contribution identity. The host resolves each handler in a new asynchronous scope. Scoped handlers do not become hidden singletons.

Call UseHostActionEntry when application behavior enters a host-owned action. The test host gives that instance priority over package service registrations. Without this call, host action entry requests fail closed.

Sensitive Behavior

Call ApproveSensitiveContributions only for each package identity that production explicitly approves. The test host creates exact schema-bound approvals. It does not disable sensitive checks or grant wildcard authority.

Authorization Example

The following call executes the registered authorization terminal and all approved restrictions. A restriction denial returns the declared failed outcome before the policy terminal runs.

var outcome = await host.ActionEntry(
        AuthorizationProtocol.Evaluate,
        new AuthorizationRequest(
            "documents.read",
            new AuthorizationResource("document", documentId)))
    .RunAsync(cancellationToken);

This package is test-only. Production hosts do not reference it.

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.5.0-dev.20260925.3 0 9/25/2026
0.5.0-dev.20260920.1 56 9/20/2026
0.5.0-dev.20260919.3 53 9/19/2026
0.5.0-beta.17 68 9/2/2026
0.5.0-beta.16 63 9/2/2026
0.5.0-beta.15 66 9/2/2026
0.5.0-beta.14 67 9/2/2026
0.5.0-beta.3 80 8/14/2026