make MouseDevice mockable
Open
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
The class https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/MouseDevice.cs does not allow right now to derive from it. This prevent any Mocking library to work.
As far as I can see is it enough to change the access modifier from
`internal abstract MouseButtonState GetButtonStateFromSystem(MouseButton mouseButton);`
Code to test with Moq:
```
var t = typeof(InputManager).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[0], null);
var mouseDevice = new Moq.Mock((InputManager)t.Invoke(null)).Object;
```
Contributor guide
Assessment
This issue has not been assessed yet.