Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4333570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:24:41+00:00 2026-05-21T10:24:41+00:00

I am working on unit testing and I have to pass context of one

  • 0

I am working on unit testing and I have to pass context of one thread to other one. In real life the first one would be UI thread and all will be ok (I hope). But my unit test has not UI (it is some testing thread).
I have read: “One thread that always has a SynchronizationContext is the UI thread.”
Is it possible to attach context of one thread (Non UI) to other one? How to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:24:42+00:00Added an answer on May 21, 2026 at 10:24 am

    I think you might need to rethink your testing strategy.

    If you really want to test interaction between GUI and some background task Thread safety wise, you can create simple WinForm and try it out.

    Or try to create test so that your GUI form is behaving as expected after you get some results from your back thread (i.e. displaying it correctly).

    Creating unit tests for GUIs are quite tricky. That’s why people tend to remove all the business and any other logic outside GUI so that it can be easily testable.

    maybe you can consider using WPF with MVVM, or WinForms with MVP, which makes it easier to draw that line

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on my first project in which I'm utilizing PHPUnit for unit testing.
I have a good grasp of unit testing, DI, mocks, and all the design
I have managed to get basic unit testing working, however when I add a
I am working with Silverlight Unit Testing i need to test a function which
I am working with a unit-testing suite that hijacks function calls and tests expected
I've been trying to get started with unit-testing while working on a little cli
I have a large simulation written in C++. The main working unit for the
I am working with Erlang and EUnit to do unit tests, and I would
Possible Duplicate: Using IoC for Unit Testing I think I do have a Problem
Unit testing is new to me, and I have this error I don't understand.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.