FluxFlow.Components.Assertions 3.0.1

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

FluxFlow.Components.Assertions

A standalone expression-driven assertion node for FluxFlow. It depends only on FluxFlow.Nodes and FluxFlow.Mapping — no engine, registry, or runtime. You new the node and LinkTo the next one.

Node

Node Shape Purpose
FlowAssertionComponent<TInput> Input → Output (result), Passed, Failed Evaluates an input against a boolean expression.

Every message travels as a FlowMessage<T> envelope. The assertion result is broadcast on Output as FlowMessage<FlowAssertionResult>; the original input is fanned to Passed when the assertion holds or Failed when it does not (each FlowMessage<TInput>). All three carry the same correlation id as the input.

The package does not choose an expression language: applications supply an IFlowExpressionEngine (from FluxFlow.Mapping). The node compiles the boolean expression once at construction, so each message only evaluates the compiled form.

var node = new FlowAssertionComponent<AppMessage>(
    new AssertionOptions
    {
        Expression = "score >= 10",
        InputType = "app.message",
        Description = "score-check",
        FailureMessage = "Score too low."
    },
    appExpressionEngine,
    contextFactory: new AppMessageContextFactory());

node.Output.LinkTo(resultSink, new DataflowLinkOptions { PropagateCompletion = false });
node.Passed.LinkTo(passedSink, new DataflowLinkOptions { PropagateCompletion = false });
node.Failed.LinkTo(failedSink, new DataflowLinkOptions { PropagateCompletion = false });

await node.Input.SendAsync(FlowMessage.Create(new AppMessage(score: 12)));

AssertionOptions validates at construction: a missing Expression, an empty InputType, or a non-positive BoundedCapacity fails fast as an argument exception.

Mapping context

By default the node exposes the input as the input and value variables to the expression engine. Pass an IFlowMapContextFactory<TInput> (from FluxFlow.Mapping) to project named variables from the payload — for example a score variable read by a score >= 10 expression.

Behavior

A failing assertion is not an error: the node emits a FlowAssertionResult with Status = Failed and routes the original input to Failed. A passing assertion emits a result and routes the input to Passed. Routing can be suppressed per port via AssertionOptions.EmitPassedInput / EmitFailedInput. Expression evaluation failures emit a FlowError on Errors (carrying the input's correlation id and AssertionErrorCodes.ExpressionFailed) and the node keeps processing later messages. Per-message flow.assert.evaluated / flow.assert.failed events flow on the Events port.

Runtime timing

Assertion results use the node's clock for EvaluatedAt (default TimeProvider.System). Provide a deterministic clock for tests:

new FlowAssertionComponent<object>(options, engine, clock: new FakeTimeProvider(timestamp));

Composition

Add FluxFlow.Components.Assertions.Composition when a host wants to instantiate assertion nodes from FluxFlow.Composition fluent/config definitions. That optional package registers closed generic FlowAssertionComponent<TInput> factories.

services.AddKeyedSingleton<IFlowExpressionEngine>("default", expressionEngine);

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry =>
        registry.RegisterAssertion<AppMessage>());

Use custom node type names when one host needs several input shapes:

registry
    .RegisterAssertion<OrderMessage>("flow.assert.order")
    .RegisterAssertion<HttpResponseOutput>("flow.assert.http-response");

Composition resolves the expression engine from the keyed engine resource. Optional keyed contextFactory and clock resources can provide custom expression variables and deterministic result/diagnostic timestamps. The configured InputType remains diagnostic metadata; CLR port types come from the closed generic registration.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.Assertions:

Package Downloads
FluxFlow.Components.Assertions.Composition

Optional typed assertion registration and Designer metadata over host-owned keyed expression resources.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0-rc.1 93 9/5/2026
6.0.0 189 8/3/2026
3.0.2 137 7/3/2026
3.0.1 183 7/2/2026
3.0.0 135 6/19/2026
2.0.0 153 6/18/2026
1.2.1 133 6/15/2026
1.2.0 433 6/12/2026
1.1.0 123 6/5/2026
1.0.0 129 6/4/2026
0.2.0-alpha.1 256 6/2/2026
0.1.1-alpha.1 89 6/2/2026
0.1.0-alpha.1 104 6/1/2026

Aligns constructor option validation with standalone node conventions: missing expression and empty inputType now report ArgumentException, while non-positive boundedCapacity reports ArgumentOutOfRangeException. Runtime assertion behavior is unchanged.