I am trying to unit test a WPF control and need to simulate key down presses. I have seen a possible solution here, however when I try to pass in a PresentationSource I keep getting a null value (from either PresentationSource.FromVisual() or PresentationSource.FromDependencyObject()) which triggers an exception.
My question is how do I get a non-null PresentationSource that I can use in unit tests?