-
Hello! Is there a way to create multiple instances of application in single test run? I know that desktop lifetime requires single instance of app so let's say I will execute tests one by one, But this code fails if execute it twice:
Any ideas how to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
I don't think it possible to have multiple app instances in one process, since avalonia uses static services locator and dispatcher. Also it might not be possible on some platforms to run multiple UI threads at all (see: macos), but this specific problem can be solved with Headless platform, starting tests without any UI and rendering, but with all visual elements and ability to raise input events. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/AvaloniaUI/Avalonia/blob/master/tests/Avalonia.UnitTests/UnitTestApplication.cs |
Beta Was this translation helpful? Give feedback.
I don't think it possible to have multiple app instances in one process, since avalonia uses static services locator and dispatcher.
Also it might not be possible on some platforms to run multiple UI threads at all (see: macos), but this specific problem can be solved with Headless platform, starting tests without any UI and rendering, but with all visual elements and ability to raise input events.