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
                    
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="Codalus.Plugins.Testing" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Codalus.Plugins.Testing" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Codalus.Plugins.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 Codalus.Plugins.Testing --version 1.2.0
                    
#r "nuget: Codalus.Plugins.Testing, 1.2.0"
                    
#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 Codalus.Plugins.Testing@1.2.0
                    
#: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=Codalus.Plugins.Testing&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Codalus.Plugins.Testing&version=1.2.0
                    
Install as a Cake Tool

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 PluginTestHost deactivates 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 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
1.2.0 92 10/30/2026