QaaS.Mocker 2.0.0-alpha.3

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

QaaS.Mocker

QaaS.Mocker runs configurable mock servers for QaaS workloads.

Supported protocols:

  • Http / Https
  • Grpc / Grpcs
  • Socket
  • Optional Redis controller API (ping + runtime commands)

Project Flow

  1. Bootstrap.New(args) parses CLI options into MockerOptions.
  2. MockerLoader builds InternalContext from YAML + overwrite files/arguments + env variables.
  3. ExecutionBuilder validates config, loads hooks, builds:
    • Data sources
    • Transaction stubs
    • Server implementation (HttpServer, GrpcServer, or SocketServer)
    • Optional controller
  4. Execution.Start() runs one mode:
    • Run: starts server (and controller when configured)
    • Lint: validates configuration/build path
    • Template: prints or writes a generated template YAML
  5. Server state objects route incoming actions/RPCs/messages to transaction stubs and cache input/output for controller consume commands.

Hook loading uses QaaS provider modules (HooksLoaderModule<T>) and resolves hooks from loaded assemblies. This keeps processor integrations pluggable: you can add processors from YAML or by code configuration as long as the assembly containing those ITransactionProcessor implementations is available at runtime.

Solution Layout

  • QaaS.Mocker: CLI, bootstrap, execution orchestration
  • QaaS.Mocker.Stubs: stub factory + transaction stub execution
  • QaaS.Mocker.Servers: HTTP/gRPC/socket servers and state routing
  • QaaS.Mocker.Controller: Redis control handlers
  • QaaS.Mocker.Example: runnable example configs/processors
  • QaaS.Mocker.*.Tests: NUnit unit tests

Code Configuration

ExecutionBuilder supports code-first CRUD operations:

  • Data sources: CreateDataSource, ReadDataSource, UpdateDataSource, DeleteDataSource
  • Stubs: CreateStub, ReadStub, UpdateStub, DeleteStub
  • Server/controller: Read*, Update*, Replace*, DeleteController

TransactionStubBuilder supports configuring processor hook names and configuration objects in code (Configure(object)).

Prerequisites

  • .NET SDK 10.0.x
  • Docker Desktop (optional, for image build/run)
  • dotnet dev-certs (included with .NET SDK) for local TLS example

Build And Test

dotnet restore QaaS.Mocker.sln
dotnet build QaaS.Mocker.sln -c Release -warnaserror
dotnet test QaaS.Mocker.sln -c Release --no-build

Run Example Without Any Script

No script is required.

  1. Generate a dev certificate file expected by example YAML:
dotnet dev-certs https -ep QaaS.Mocker.Example/Certificates/devcert.pfx -p qaas-dev-cert
  1. Trust the certificate (local machine):
dotnet dev-certs https --trust
  1. Run HTTPS example:
cd QaaS.Mocker.Example
dotnet run --project . -- mocker.qaas.yaml
  1. Verify endpoint:
curl -k https://localhost:8443/health

Run gRPC Example

cd QaaS.Mocker.Example
dotnet run --project . -- mocker.grpc.qaas.yaml

The gRPC service listens on localhost:50051 with TLS and exposes EchoService/Echo.

Build And Run Docker Image

  1. Ensure QaaS.Mocker.Example/Certificates/devcert.pfx exists (see cert generation command above).
  2. Build image:
docker build -t qaas-mocker-example .
  1. Run image (default entrypoint uses mocker.qaas.yaml):
docker run --rm -p 8443:8443 qaas-mocker-example

CI / Publish

Workflow: .github/workflows/ci.yml

  • Restores, builds with -warnaserror, and runs tests
  • On tags: validates SemVer, packs QaaS.Mocker, pushes NuGet package
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
2.2.0 0 3/31/2026
2.1.1 108 3/28/2026
2.1.0 74 3/25/2026
2.0.6 101 3/23/2026
2.0.6-alpha.1 37 3/22/2026
2.0.5 132 3/21/2026
2.0.5-alpha.4 35 3/22/2026
2.0.5-alpha.3 38 3/21/2026
2.0.5-alpha.1 39 3/21/2026
2.0.4 87 3/21/2026
2.0.3 82 3/17/2026
2.0.2 76 3/17/2026
2.0.1 87 3/16/2026
2.0.0 84 3/16/2026
2.0.0-alpha.12 43 3/15/2026
2.0.0-alpha.11 41 3/15/2026
2.0.0-alpha.7 47 3/11/2026
2.0.0-alpha.6 39 3/6/2026
2.0.0-alpha.5 38 3/5/2026
2.0.0-alpha.3 37 3/5/2026
Loading failed