Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would suggest that you provide you own <code>IScheduler</code> implementation to <code>ObserveOn(IScheduler)</code> instead of using the <code>ObserveOnDispatcher()</code> operator. I have used techniques for loading a <code>DispatcherFrame</code> or a <code>Dispatcher</code> but the problem is that you are still using a Dispatcher. Eventually I found that you just "fall off the cliff" especially once you have long running background threads involved. Following the guidelines of "No threading in Unit tests" just dont let the dispatcher get near your ViewModels! Your Unit tests will run much, much faster.</p> <p>A far superior way to deal with this is to inject an interface that gives access to your Dispatcher Scheduler (via the <code>IScheduler</code> interface). This allows you to substitute in an implementation that exposes the <code>TestScheduler</code>. You now can control time in your unit test. You can control and validate which actions are marshalled to each scheduler.</p> <p>This is a really old (pre-Rx) post on 'Unit' testing WPF with Dispatcher calls from early 2009. It seemed like a good idea at the time.</p> <p><a href="https://leecampbell.com/2009/02/17/responsive-wpf-user-interfaces-part-5/" rel="nofollow noreferrer">https://leecampbell.com/2009/02/17/responsive-wpf-user-interfaces-part-5/</a></p> <p>More information on Testing with Rx and the <code>TestScheduler</code> is found in my other site on Rx</p> <p><a href="http://introtorx.com/Content/v1.0.10621.0/16_TestingRx.html" rel="nofollow noreferrer">http://introtorx.com/Content/v1.0.10621.0/16_TestingRx.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload