-
-
Notifications
You must be signed in to change notification settings - Fork 608
Expand file tree
/
Copy pathMouseWheelTest.cs
More file actions
36 lines (31 loc) · 940 Bytes
/
MouseWheelTest.cs
File metadata and controls
36 lines (31 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Reflection;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using Flow.Launcher.Resources.Controls;
using NUnit.Framework;
namespace Flow.Launcher.Test;
[TestFixture]
public class MouseWheelTest
{
[Test]
[RequiresThread(System.Threading.ApartmentState.STA)]
public void Test_Scroll_MouseWheel()
{
var scrollView = new CustomScrollViewerEx();
var mouseDevice = Mouse.PrimaryDevice;
var e = new MouseWheelEventArgs(mouseDevice, Environment.TickCount, 120)
{
RoutedEvent = UIElement.MouseWheelEvent
};
var onMouseWheelMethod = typeof(CustomScrollViewerEx).GetMethod(
"OnMouseWheel",
BindingFlags.NonPublic | BindingFlags.Instance
);
Assert.DoesNotThrow(() =>
{
onMouseWheelMethod.Invoke(scrollView, new object[] { e });
});
}
}