Comments (18)
Thanks for the write-up. [UIFact]
is a framework-agnostic attribute that just emulates common things like a generic SyncContext to keep test execution on a single thread.
It sounds like WinUI has its own specialized SyncContext, which is similar to WinForms and WPF and why they eachhave their own attributes. Cocoa has its own fact too. If you can help us understand the specific requirements for emulating a WinUI main thread, adding support for that sounds good.
As for the issues you ran into, that sounds like it might have just been an issue with how you patched and used the modified DLL.
I'm happy to take a look as well. Where did you get the DispatcherQueueSynchronizationContext
type? I don't see it available.
from xunit.stafact.
from xunit.stafact.
The Microsoft.WindowAppSDK
package doesn't appear on nuget.org. I can't help make this work without the sync context type that you're talking about.
from xunit.stafact.
from xunit.stafact.
No. I don't know how ***@***.***
would help.
from xunit.stafact.
from xunit.stafact.
from xunit.stafact.
Thanks. Ya your image attachments are not coming from your email to the github issue comment. But your link worked. Apparently the nuget package ID is slightly different than you originally quoted (a typo, no doubt). I should be able to look into this now. Probably sometime next week.
from xunit.stafact.
So I gave this a shot. You can review it here.
This isn't as simple as it sounded. To create a DispatcherQueueSynchronizationContext
, I need a DispatcherQueue
as well, but these things aren't directly creatable it seems. How does one get one of these?
It sounds like you actually had a compilable thing that you expected to work, though it didn't. I'm finding it quite difficult to get something remotely close to working. So anything you can share from your original prototype would help expedite this.
from xunit.stafact.
from xunit.stafact.
from xunit.stafact.
from xunit.stafact.
Thanks for the blog link. I guess I have to create a Window
object to get its DispatcherQueue
property from it. I'm trying with that now.
the exception text in WaitForOperationCompletionAsync says WPF not WinUI.
Thanks. Fixed.
The exception itself is concerning. I will need to test async methods that must be run on the UI thread. The message says no “async void”. Does that mean “async Task” are ok? You have such tests in WpfFactTests.cs, so I’m guessing they are, but staring at the code in the diff tells me nothing.
Yes, async Task
test methods are fine. It's the async void
tests that don't work.
from xunit.stafact.
I've made a lot of progress. But the blog post is 2+ years old, and I had to make some changes to get WinUI tests building the way it proposed. But they don't run even with UITestMethod
attributes. And the blog outlines some tight-knit interactions between the test runner and test framework, and assume that the test runner will execute the .exe instead of loading the test assembly as a library into another process. I don't know if xunit can do this. This could require xunit changes as well.
from xunit.stafact.
from xunit.stafact.
Yes, I understand the concession may include running an .exe. But unless you know of a way to get xunit tests to execute within an .exe test project that launches itself instead of by way of the xunit or dotnet test
test runners, I don't see how we can make this work with xunit.
from xunit.stafact.
from xunit.stafact.
I don't know how you would make this work at this point. And xunit.stafact as an xunit library that your test project loads isn't properly positioned to spin up xunit.
from xunit.stafact.
Related Issues (20)
- Suggestion: Skip support (SkippableFact) HOT 4
- [StaFact] tests not found when used with netcoreapp2.2 HOT 13
- StaTheory is not supported in Visual Studio Runner HOT 13
- Support for OleInitialize HOT 2
- WPF support on .NET Core 3.0 breaks .NET Core 3.0 consumers on Linux/Mac
- Can't run tests HOT 2
- Generate test arguments on test thread
- CPU usage in polling message loop HOT 4
- Hanging UITheoryTestCase
- Clarify attribute names, or rename package ID HOT 8
- CollectionAttribute seems to be not respected HOT 7
- [StaFact] tests do not execute when targeting net462 HOT 8
- .net 4.5.2 compatibility HOT 3
- netstandard support HOT 1
- STA for Fixture Collections HOT 5
- StaFact facts breaks the concurrency limitations of Xunit HOT 11
- Running all tests within a class on the same thread? HOT 12
- [MainThreadFact] to execute tests on main thread on macos HOT 6
- Custom Thread HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xunit.stafact.