Consolonia.NUnit
11.2.1-alpha-782
See the version list below for details.
dotnet add package Consolonia.NUnit --version 11.2.1-alpha-782
NuGet\Install-Package Consolonia.NUnit -Version 11.2.1-alpha-782
<PackageReference Include="Consolonia.NUnit" Version="11.2.1-alpha-782" />
paket add Consolonia.NUnit --version 11.2.1-alpha-782
#r "nuget: Consolonia.NUnit, 11.2.1-alpha-782"
// Install Consolonia.NUnit as a Cake Addin #addin nuget:?package=Consolonia.NUnit&version=11.2.1-alpha-782&prerelease // Install Consolonia.NUnit as a Cake Tool #tool nuget:?package=Consolonia.NUnit&version=11.2.1-alpha-782&prerelease
Consolonia.NUnit
This package provides testing support for testing consolonia controls using NUnit.
Background
Consolonia is a TUI (Text User Interface) (GUI Framework) implementation for Avalonia UI
Supports XAML, data bindings, animation, styling and the rest from Avalonia.
Showcase (click picture to see video)
Usage
To create a unit test against your consolonia application your test class should derive from ConsoloniaAppTestBase<App$gt;.
You can define the size of your console by passing size parameter to base class.
Then you can use UITest to interact with your application, and use UITest.AssertHasText() to verify the screen of text matches your expectation.
UITest.AssertHasText()
Takes one or more Regex patterns and verifies that the screen contains the text that matches the pattern.
UITest.AssertHasNoText()
Takes one or more Regex patterns and verifies that the screen does not contain the text that matches the pattern.
Example
public class Tests : ConsoloniaAppTestBase<App>
{
public Tests : base(new PixelBufferSize(80, 40))
{
}
[Test]
public async Task DisplaysBasicText()
{
await UITest.KeyInput(Key.Tab);
await UITest.AssertHasText("This is TextBlock");
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Consolonia.Core (>= 11.2.1-alpha-782)
- NUnit (>= 3.13.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.