Commit Graph

11 Commits

Author SHA1 Message Date
Antony Male fc7f164c53 Remove unnecessary usings in unit tests 2015-09-23 21:46:36 +01:00
Antony Male d62ea7a22d Allow setting of Execute.InDesignMode, for obscure unit testing ONLY 2015-01-05 12:22:00 +00:00
Antony Male f36de34bb2 Execute.Dispatcher can never be null, and dispatches synchronously by default
The previous behaviour was to raise an exception unless Execute.Dispatcher
had been explicitly defined. This was to detect cases where the user hadn't
set up Execute correctly, and treat them as errors rather than simply going
ahead with some possibly-unexpected behaviour.

However, since BootstrapperBase sets Execute.Dispatcher automatically, it's
highly unlikely that itwould ever not be set when it needed to be. Exceptions
are design mode and unit tests, both of which want (or can cope with) a
synchronous dispatcher.

Hence the behaviour change. Execute.Dispatcher is a synchronous dispatcher
by default, but is overridden to one that uses Application.Current.Dispatcher
by the bootstrapper if we're in a real application.
2015-01-04 21:30:34 +00:00
Antony Male 9ee23f1469 Remove Execute.TestExecuteSynchronously, in favour of a synchronous IDispatcher implementation 2015-01-04 13:10:37 +00:00
Antony Male 642a038488 Add Execute.PostToUIThreadAsync 2014-07-26 11:51:46 +01:00
Antony Male 0b75df35ef Rename Execute methods 2014-05-11 19:59:23 +01:00
Antony Male a39bcfbadb Use Dispatcher instead of SynchronizationContext for synchronization.
It looks like the SynchronizationContext can now change on the same thread
(see http://msdn.microsoft.com/en-us/library/system.windows.basecompatibilitypreferences.reusedispatchersynchronizationcontextinstance%28v=vs.110%29.aspx)
meaning that we can no longer do a reference comparison between SynchronizationContext.Current
and the captured SynchronizationConext to check whether a dispatch is required.
It turns out we shouldn't have been doing this anyway.... So switch to using a Dispatcher,
which does support this stuff.

Additionally, Execute now uses an IDispatcher, which means the implementation can be switched
again in the future. It also makes unit testing easier....
2014-05-09 15:46:03 +01:00
Antony Male 4a527c75d6 Push code coverage up to 98.7%, including integration tests 2014-05-09 14:40:40 +01:00
Antony Male 4fa4133248 Improve unit test code coverage some more 2014-05-06 17:42:55 +01:00
Antony Male 4711e3fefa Fix tests involving changes to Execute 2014-04-24 12:58:09 +01:00
Antony Male 31c9844c47 Add more conductor tests, and tests for Execute, PropertyChangedBase 2014-03-25 13:20:31 +00:00