NPipeline.Extensions.Testing.FluentAssertions 0.16.0

dotnet add package NPipeline.Extensions.Testing.FluentAssertions --version 0.16.0
                    
NuGet\Install-Package NPipeline.Extensions.Testing.FluentAssertions -Version 0.16.0
                    
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="NPipeline.Extensions.Testing.FluentAssertions" Version="0.16.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NPipeline.Extensions.Testing.FluentAssertions" Version="0.16.0" />
                    
Directory.Packages.props
<PackageReference Include="NPipeline.Extensions.Testing.FluentAssertions" />
                    
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 NPipeline.Extensions.Testing.FluentAssertions --version 0.16.0
                    
#r "nuget: NPipeline.Extensions.Testing.FluentAssertions, 0.16.0"
                    
#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 NPipeline.Extensions.Testing.FluentAssertions@0.16.0
                    
#: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=NPipeline.Extensions.Testing.FluentAssertions&version=0.16.0
                    
Install as a Cake Addin
#tool nuget:?package=NPipeline.Extensions.Testing.FluentAssertions&version=0.16.0
                    
Install as a Cake Tool

NPipeline.Extensions.Testing.FluentAssertions

NPipeline.Extensions.Testing.FluentAssertions provides FluentAssertions extensions for testing NPipeline pipelines. This package adds fluent assertion methods specifically designed for pipeline execution results and in-memory sink nodes, making it easier to write expressive and readable tests for your data processing pipelines.

About NPipeline

NPipeline is a high-performance, extensible data processing framework for .NET that enables developers to build scalable and efficient pipeline-based applications. It provides a rich set of components for data transformation, aggregation, branching, and parallel processing, with built-in support for resilience patterns and error handling.

Installation

dotnet add package NPipeline.Extensions.Testing.FluentAssertions

Requirements

  • .NET 8.0, 9.0, or 10.0
  • FluentAssertions 8.8.0 or later
  • NPipeline.Extensions.Testing (automatically included as a dependency)

Features

  • Fluent Assertion Methods: Provides expressive assertion methods for pipeline testing
  • Pipeline Execution Assertions: Assert on pipeline success, failure, errors, and execution time
  • In-Memory Sink Assertions: Validate data captured by in-memory sink nodes
  • FluentAssertions Integration: Seamlessly integrates with the popular FluentAssertions library
  • Chainable Assertions: All methods return the original object for fluent chaining

Usage

Basic Pipeline Execution Assertions

using NPipeline.Extensions.Testing.FluentAssertions;
using FluentAssertions;

// Execute a pipeline
var result = await pipeline.ExecuteAsync();

// Assert successful execution
result.ShouldBeSuccessful()
      .ShouldHaveNoErrors()
      .ShouldCompleteWithin(TimeSpan.FromSeconds(5));

// Assert failed execution
result.ShouldFail()
      .ShouldHaveErrorCount(1)
      .ShouldHaveErrorOfType<InvalidOperationException>();

In-Memory Sink Assertions

using NPipeline.Extensions.Testing.FluentAssertions;

// Create an in-memory sink for testing
var sink = new InMemorySinkNode<int>();

// Assert on received items
sink.ShouldHaveReceived(5);
sink.ShouldContain(42);
sink.ShouldNotContain(99);

// Assert with predicates
sink.ShouldContain(x => x > 10);
sink.ShouldOnlyContain(x => x >= 0);

Complete Test Example

using NPipeline.Extensions.Testing.FluentAssertions;
using FluentAssertions;

[Fact]
public async Task Pipeline_Should_Process_Data_Correctly()
{
    // Arrange
    var source = new InMemorySourceNode<int>([1, 2, 3, 4, 5]);
    var transform = new TransformNode<int, int>(x => x * 2);
    var sink = new InMemorySinkNode<int>();

    var pipeline = PipelineBuilder.Create()
        .AddSource(source)
        .AddNode(transform)
        .AddSink(sink)
        .Build();

    // Act
    var result = await pipeline.ExecuteAsync();

    // Assert
    result.ShouldBeSuccessful()
          .ShouldHaveNoErrors()
          .ShouldCompleteWithin(TimeSpan.FromSeconds(1));

    sink.ShouldHaveReceived(5)
        .ShouldContain(2)
        .ShouldContain(10)
        .ShouldOnlyContain(x => x > 0);
}

License

MIT License - see LICENSE file for details.

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 is compatible.  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

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.16.0 26 2/24/2026
0.15.0 80 2/19/2026
0.14.0 90 2/17/2026
0.13.1 80 2/13/2026
0.13.0 81 2/13/2026
0.12.0 86 2/9/2026
0.11.0 90 2/8/2026
0.10.0 87 2/6/2026
0.9.1 84 2/5/2026
0.9.0 89 2/5/2026
0.8.0 86 2/3/2026
0.7.1 89 2/1/2026
0.7.0 90 1/31/2026
0.6.6 96 1/21/2026
0.6.5 96 1/19/2026
0.6.4 87 1/18/2026
0.6.3 88 1/14/2026
0.6.2 89 1/13/2026
0.6.1 97 1/13/2026
0.6.0 103 1/13/2026
Loading failed