Replies: 2 comments
-
|
Maybe you could do it with an in-project Reqnroll plugin. You would only need to add this to your project (not tested): |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Unfortunately calling InvalidOperationException: Failed to set the specified COM apartment state. Current apartment state 'MTA'.Ideally in MVVM, the Thank you @gasparnagy for taking the time to respond to my question. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Reqnroll community.
I am currently exploring the idea of combining Reqnroll with
ViewModellevel testing of a C# WPF application.The Problem
Approach 1
Apparently you can configure MS Test to run in STA mode by simply:
Problem:
AssemblyInitializecan only be referenced once & Reqnroll uses this attribute in the generated Reqnroll code behind.Approach 2
The following code compiles & runs as expected:
Problem:
Substitute.For<Window>()is called from a Reqnroll step, .NET Core 8 throws an exception:InvalidOperationExceptionThe calling thread must be STA, because many UI components require this.Question
Is there an easy way to configure Reqnroll to run in STA mode? Any guidance you can provide would be appreciated.
Context
Related Discussions
It would be nice if the view model only referenced other view models (i.e. had no concept of a WPF
Window), but let's assume that I do not have control over this implementation detail.Beta Was this translation helpful? Give feedback.
All reactions