Asterisk.Sdk.VoiceAi.Testing
1.15.3
dotnet add package Asterisk.Sdk.VoiceAi.Testing --version 1.15.3
NuGet\Install-Package Asterisk.Sdk.VoiceAi.Testing -Version 1.15.3
<PackageReference Include="Asterisk.Sdk.VoiceAi.Testing" Version="1.15.3" />
<PackageVersion Include="Asterisk.Sdk.VoiceAi.Testing" Version="1.15.3" />
<PackageReference Include="Asterisk.Sdk.VoiceAi.Testing" />
paket add Asterisk.Sdk.VoiceAi.Testing --version 1.15.3
#r "nuget: Asterisk.Sdk.VoiceAi.Testing, 1.15.3"
#:package Asterisk.Sdk.VoiceAi.Testing@1.15.3
#addin nuget:?package=Asterisk.Sdk.VoiceAi.Testing&version=1.15.3
#tool nuget:?package=Asterisk.Sdk.VoiceAi.Testing&version=1.15.3
Asterisk.Sdk.VoiceAi.Testing
Test fakes for Asterisk.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 Asterisk.Sdk.VoiceAi.Testing
Typically referenced from your test project only.
Quick start
using Asterisk.Sdk.VoiceAi.Testing;
using Asterisk.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/Asterisk.Sdk.VoiceAi.Tests/ and Tests/Asterisk.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 Asterisk.Sdk project.
| Product | Versions 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. |
-
net10.0
- Asterisk.Sdk.VoiceAi (>= 1.15.3)
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 | |
|---|---|---|---|
| 1.15.3 | 154 | 5/3/2026 | |
| 1.15.2 | 125 | 4/27/2026 | |
| 1.15.1 | 136 | 4/26/2026 | |
| 1.15.0 | 172 | 4/20/2026 | |
| 1.14.0 | 124 | 4/20/2026 | |
| 1.13.0 | 132 | 4/20/2026 | |
| 1.12.0 | 135 | 4/19/2026 | |
| 1.11.1 | 121 | 4/19/2026 | |
| 1.11.0 | 129 | 4/19/2026 | |
| 1.10.2 | 127 | 4/18/2026 | |
| 1.10.1 | 122 | 4/18/2026 | |
| 1.10.0 | 155 | 4/18/2026 | |
| 1.9.0 | 126 | 4/17/2026 | |
| 1.8.1 | 131 | 4/16/2026 | |
| 1.8.0 | 137 | 4/13/2026 | |
| 1.7.0 | 123 | 4/13/2026 | |
| 1.6.0 | 121 | 4/13/2026 | |
| 1.5.5 | 130 | 4/9/2026 | |
| 1.5.3 | 1,099 | 3/30/2026 | |
| 1.5.2 | 143 | 3/30/2026 |