PGMS.ScenarioTesting 5.0.0

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

Introduction

PGMS.CQSLight is a small, open-source library that provides a simple and easy-to-use interface for implementing the Command Query Separation (CQS) pattern in .NET Core applications. The library is designed to be lightweight, flexible, and easy to test.

The CQS pattern is a software design pattern that separates the responsibility of executing a command from the responsibility of querying data. The pattern is based on the idea that a method or function should either change the state of the system or retrieve data, but not both.

In PGMS.CQSLight, commands and queries are separated into different interfaces, and each command and query is handled by a specific handler. The library also provides a simple interface for dispatching commands and handling queries.

PGMS.CQSLight is built with SOLID principles, which makes the code maintainable, scalable, and testable. It's an easy to use library, and it's a good fit for small and medium-sized projects that need to implement the CQS pattern.


PGMS.ScenarioTesting

Scenario testing framework for integration and end-to-end testing

This package provides a structured approach to writing scenario-based integration tests using the Given-When-Then pattern with NUnit.

Key Features

  • Scenario Test Framework: BaseScenarioTest base class for organizing tests with Given/When/Then structure

  • Test Actions:

    • ScenarioTestCommand<T>: Execute commands in test scenarios
    • ScenarioTestQuery<T, TResult>: Execute queries with result validation
    • ScenarioTestCommandWithValidationFailure<T>: Test expected validation failures
    • ScenarioTestDataValidation: Validate data state using repository
    • ScenarioTestDataManipulation: Manipulate test data directly
  • Test Helpers:

    • IScenarioTestHelper: Abstraction for test execution
    • ScenarioTestHelperInMemoryImplementation<TContext>: In-memory testing with Autofac container
    • ScenarioTestHelperIntegratedImplementation<TContext>: Integration testing against real database or API
  • API Testing: ICqsApiHelper for testing CQS operations through HTTP APIs with RestSharp

Usage

Scenario tests provide a clear, readable structure for integration tests:

  1. Givens: Set up initial state (run once before all tests)
  2. Actions: Execute commands and queries with validation
  3. Assertions: Verify expected outcomes

This approach makes tests self-documenting and easier to maintain, while supporting both in-memory and integrated testing strategies.


Getting Started

Have a look at our sample app based on PGMS.CQSLight: GitHub Repository

Version 5.X ⇒ DotNet 10.0
Version 4.X ⇒ DotNet 8.0
Version 3.X ⇒ DotNet 6.0
Version 2.X ⇒ DotNet 5.0

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
5.0.0 410 11/17/2025
5.0.0-RC2 200 11/14/2025
4.2.12.8 9,027 10/14/2025
4.2.12.7 165 10/14/2025
4.2.12.6 2,539 9/26/2025
4.2.12.5 353 9/24/2025
4.2.12.4 271 9/13/2025
4.2.12.3 100 9/13/2025 4.2.12.3 is deprecated because it has critical bugs.
4.2.12.2 175 9/6/2025
4.2.12.1 184 8/14/2025