public ClassUnderTest(IDispatcher dispatcher = null) { _dispatcher = dispatcher ?? new UiDispatcher(Application.Current?.Dispatcher); } Mocking the dispatcher inside unit tests (in this case my event handler is OnMyEventHandler and accepts a single bool parameter called myBoolParameter) More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.