AvaloniaUI / avalonia-dotnet-templates

Avalonia Templates for `dotnet new`
MIT License
463 stars 79 forks source link

XUnit/NUnit headless templates #223

Open maxkatz6 opened 11 months ago

maxkatz6 commented 11 months ago

Is your feature request related to a problem? Please describe.

It would greatly improve the adoption of Headless testing if we ship testing templates as well

Describe the solution you'd like

Two templates based on Nunit and Xunit with:

Possibly a third template with a whole solution together (xplat?) and sharing application between them?

Describe alternatives you've considered

No response

Additional context

Headless platform documentation https://docs.avaloniaui.net/docs/next/concepts/headless/

jameswallacew8 commented 9 months ago

@maxkatz6 Do you know of any implementations of the headless platform that you could link here? Would really appreciate it :)

grokys commented 9 months ago

Avalonia.Controls.TreeDataGrid uses headless tests:

https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/tree/master/tests/Avalonia.Controls.TreeDataGrid.Tests

10Peppermill commented 1 month ago

Are there any plans to include this in an upcomming release? I'm going through the process of writing some tests for my app now and am really wishing I had a templated project or a delibirate/ containerized example of the setup for these headless tests to go off of. Refrences to UnitTest in source are usefull, but for me as a bit of a novice they can be a bad place to start learning. Maybe this just a criticism of myself idk, either way this is definetly something I'd find useful personaly.

maxkatz6 commented 1 month ago

@10Peppermill we have some generic samples as well: https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/Testing/TestableApp.Headless.XUnit. If it might help.

10Peppermill commented 1 month ago

@maxkatz6 Oh I wasn't able to find these on my own, thank you so muchI