I need to unit test methods, which are executing some actions on UI thread, like:
internal void MyMethod()
{
Dispatcher.UIThread.Post(() =>
{
// some property set
// some method call
});
}
One thing I want to test is, if Dispatcher.UIThread.Post() was called (I'm preparing for some heavier refactorig). Is it possible to mock this Post() method, or entire Dispatcher class for this test in Avalonia?