CxAgent.Plugins.Testing
0.9.49
dotnet add package CxAgent.Plugins.Testing --version 0.9.49
NuGet\Install-Package CxAgent.Plugins.Testing -Version 0.9.49
<PackageReference Include="CxAgent.Plugins.Testing" Version="0.9.49" />
<PackageVersion Include="CxAgent.Plugins.Testing" Version="0.9.49" />
<PackageReference Include="CxAgent.Plugins.Testing" />
paket add CxAgent.Plugins.Testing --version 0.9.49
#r "nuget: CxAgent.Plugins.Testing, 0.9.49"
#:package CxAgent.Plugins.Testing@0.9.49
#addin nuget:?package=CxAgent.Plugins.Testing&version=0.9.49
#tool nuget:?package=CxAgent.Plugins.Testing&version=0.9.49
CxAgent.Plugins.Testing
Check and call a cxagent plugin from a test, with no
session and no model. It uses the loaders, the permission gate and the lifecycle a session uses, so
a plugin that passes here loads and asks the way it will for a user. It is the same engine as
cxagent plugin check and cxagent plugin call.
Native plugins work too: the package carries the plugin host, so a test needs no cxagent installed.
<PackageReference Include="CxAgent.Plugins.Testing" Version="0.9.*" />
using CxAgent.Plugins.Testing;
[Fact]
public async Task SearchAsksAndAnswers()
{
Assert.Empty(await PluginHarness.CheckAsync(PluginDir)); // what check reports
await using var plugin = await PluginHarness.LoadAsync(PluginDir);
var call = await plugin.CallAsync("search", new { city = "Athens" }, answer: GateAnswer.Allow);
Assert.Equal("look up the weather for Athens", call.Gate?.Display);
Assert.True(call.Result!.Success);
Assert.Contains(call.Progress, p => p.Percent == 50);
}
PluginDir is a plugin folder: its <name>.plugin.json and the library beside it, as a user
installs it.
- Testing a plugin: every option of the harness and the CLI
- The plugin SDK: tutorials, in C# and in C
| 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
- CxAgent.Core (>= 0.9.49)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.