Verbara.Sdk.VoiceAi.Testing 2.1.1

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

Verbara.Sdk.VoiceAi.Testing

Test fakes for Verbara.Sdk.VoiceAi — exercise your turn-based pipeline, conversation handlers, and AudioSocket plumbing without touching real STT/TTS APIs (no API keys, no network, no flakiness). Native AOT, zero reflection, MIT licensed.

What it does

Three fakes, all implementing the same interfaces as the real providers:

Fake Replaces Behavior
FakeSpeechRecognizer ISpeechRecognizer Emits a configured sequence of transcripts on cue. Supports per-turn delay simulation.
FakeSpeechSynthesizer ISpeechSynthesizer Returns canned PCM16 byte arrays. Configurable byte count + delivery cadence to simulate streaming TTFA.
FakeConversationHandler IConversationHandler Echoes input or returns scripted responses. Useful when testing Stt + Tts wiring without business logic.

Drop-in replacements: same DI shape, same lifecycle, same telemetry surface — your wiring code stays unchanged between unit tests and production.

Install

dotnet add package Verbara.Sdk.VoiceAi.Testing

Typically referenced from your test project only.

Quick start

using Verbara.Sdk.VoiceAi.Testing;
using Verbara.Sdk.VoiceAi.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

// Stub the recognizer with a fixed transcript sequence
var fakeStt = new FakeSpeechRecognizer();
fakeStt.QueueTranscript("hello world");
fakeStt.QueueTranscript("goodbye");

// Stub the synthesizer with a 16 kHz / 200 ms PCM clip
var fakeTts = new FakeSpeechSynthesizer { OutputSampleCount = 3200 };

var services = new ServiceCollection();
services.AddSingleton<ISpeechRecognizer>(fakeStt);
services.AddSingleton<ISpeechSynthesizer>(fakeTts);
services.AddVoiceAiPipeline<MyConversationHandler>();

var provider = services.BuildServiceProvider();
var pipeline = provider.GetRequiredService<IVoiceAiPipeline>();

await pipeline.ProcessTurnAsync(audioInput, ct);

Assert.Equal(2, fakeStt.TranscriptsConsumed);
Assert.True(fakeTts.SynthesizeInvocations >= 1);

Why use it

  • No API keys in CI — your test pipeline runs offline against deterministic fakes.
  • Deterministic timing — pin TTFA / latency assertions to fake delays, not provider variance.
  • Failure injection — every fake exposes hooks to throw on the next call, simulate slow responses, or report partial transcripts.
  • Fast — fakes return synchronously where possible; full pipeline turns finish in microseconds.

Examples

See Tests/Verbara.Sdk.VoiceAi.Tests/ and Tests/Verbara.Sdk.VoiceAi.Testing.Tests/ for end-to-end usage patterns including barge-in, turn-taking, and pipeline-level integration tests.

License

MIT. Part of the Verbara.Sdk project.

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.1 130 5/23/2026
2.2.0 109 5/20/2026
2.1.2 103 5/8/2026
2.1.1 98 5/7/2026
2.1.0 646 5/7/2026
2.0.0 100 5/6/2026