Codalus.Plugins.Testing
1.2.0
dotnet add package Codalus.Plugins.Testing --version 1.2.0
NuGet\Install-Package Codalus.Plugins.Testing -Version 1.2.0
<PackageReference Include="Codalus.Plugins.Testing" Version="1.2.0" />
<PackageVersion Include="Codalus.Plugins.Testing" Version="1.2.0" />
<PackageReference Include="Codalus.Plugins.Testing" />
paket add Codalus.Plugins.Testing --version 1.2.0
#r "nuget: Codalus.Plugins.Testing, 1.2.0"
#:package Codalus.Plugins.Testing@1.2.0
#addin nuget:?package=Codalus.Plugins.Testing&version=1.2.0
#tool nuget:?package=Codalus.Plugins.Testing&version=1.2.0
Codalus.Plugins.Testing
Headless tests for Codalus IDE plugins. TestPluginContext is an in-memory IPluginContext: it runs a plugin with no IDE and no plugin host, records what the plugin registers and shows, and drives its commands, views, trees and providers. So a plugin's tests are ordinary unit tests, with any test framework.
var context = new TestPluginContext("contoso.greeter");
context.Window.NotificationResponder = n => n.Actions.FirstOrDefault(); // the user's answer
await using var host = await PluginTestHost.ActivateAsync<GreeterPlugin>(context);
context.Settings.Set("greeter.greeting", "Ahoy"); // raises Settings.Changed
Assert.Equal(1, await context.Commands.ExecuteAsync<int>("greeter.greet"));
Assert.Equal("Ahoy!", Assert.Single(context.Window.Notifications).Message);
- Commands run with their arguments and results through JSON, as over the plugin protocol; the IDE's commands the plugin calls are answered by
OnShellCommand. - The window answers notifications, quick picks and input boxes, and records output channels, status bar items, views, trees and tasks with their progress.
- Providers the plugin registered (file systems, authentication, source control) are there to call.
- Settings and secrets are in memory. Disposing the
PluginTestHostdeactivates the plugin.
dotnet new codalus-plugin (from Codalus.Templates) makes a plugin with tests on this package. The package's version follows the plugin API's (Codalus.Plugins.Abstractions) and targets net10.0.
MIT licensed.
| 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
- Codalus.Plugins.Abstractions (>= 1.2.0)
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.2.0 | 92 | 10/30/2026 |