10
10
11
11
partial class CoreTests
12
12
{
13
- internal GameObject SetUpScene ( Type pointerType , out Pointer pointer )
13
+ private GameObject SetUpScene ( string pointerType , out Pointer pointer )
14
14
{
15
15
var gameObject = GameObject . CreatePrimitive ( PrimitiveType . Cube ) ;
16
16
gameObject . transform . position = Vector3 . zero ;
@@ -22,13 +22,12 @@ internal GameObject SetUpScene(Type pointerType, out Pointer pointer)
22
22
return gameObject ;
23
23
}
24
24
25
- private static readonly Type [ ] _testDevices = new Type [ ] { typeof ( Mouse ) , typeof ( Pen ) , typeof ( Touchscreen ) } ;
26
- // OnMouseOver/Exit and Hover events are not supported for touch
27
- private static readonly Type [ ] _testDevicesNoTouch = new Type [ ] { typeof ( Mouse ) , typeof ( Pen ) } ;
28
-
29
25
[ UnityTest ]
26
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
27
+ [ TestCase ( "Touchscreen" , ExpectedResult = null ) ]
28
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
30
29
[ Category ( "MouseEvents" ) ]
31
- public IEnumerator MouseEvents_CanReceiveOnMouseDown ( [ ValueSource ( nameof ( _testDevices ) ) ] Type pointerType )
30
+ public IEnumerator MouseEvents_CanReceiveOnMouseDown ( string pointerType )
32
31
{
33
32
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
34
33
gameObject . AddComponent < OnMouseEventsTest > ( ) ;
@@ -41,8 +40,11 @@ public IEnumerator MouseEvents_CanReceiveOnMouseDown([ValueSource(nameof(_testDe
41
40
}
42
41
43
42
[ UnityTest ]
43
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
44
+ [ TestCase ( "Touchscreen" , ExpectedResult = null ) ]
45
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
44
46
[ Category ( "MouseEvents" ) ]
45
- public IEnumerator MouseEvents_CanReceiveOnMouseUp ( [ ValueSource ( nameof ( _testDevices ) ) ] Type pointerType )
47
+ public IEnumerator MouseEvents_CanReceiveOnMouseUp ( string pointerType )
46
48
{
47
49
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
48
50
gameObject . AddComponent < OnMouseEventsTest > ( ) ;
@@ -55,8 +57,11 @@ public IEnumerator MouseEvents_CanReceiveOnMouseUp([ValueSource(nameof(_testDevi
55
57
}
56
58
57
59
[ UnityTest ]
60
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
61
+ [ TestCase ( "Touchscreen" , ExpectedResult = null ) ]
62
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
58
63
[ Category ( "MouseEvents" ) ]
59
- public IEnumerator MouseEvents_CanReceiveOnMouseUpAsButton ( [ ValueSource ( nameof ( _testDevices ) ) ] Type pointerType )
64
+ public IEnumerator MouseEvents_CanReceiveOnMouseUpAsButton ( string pointerType )
60
65
{
61
66
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
62
67
gameObject . AddComponent < OnMousEventTestTwo > ( ) ;
@@ -69,8 +74,11 @@ public IEnumerator MouseEvents_CanReceiveOnMouseUpAsButton([ValueSource(nameof(_
69
74
}
70
75
71
76
[ UnityTest ]
77
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
78
+ [ TestCase ( "Touchscreen" , ExpectedResult = null ) ]
79
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
72
80
[ Category ( "MouseEvents" ) ]
73
- public IEnumerator MouseEvents_CanReceiveOnMouseDrag ( [ ValueSource ( nameof ( _testDevices ) ) ] Type pointerType )
81
+ public IEnumerator MouseEvents_CanReceiveOnMouseDrag ( string pointerType )
74
82
{
75
83
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
76
84
gameObject . AddComponent < OnMouseEventsTest > ( ) ;
@@ -85,8 +93,10 @@ public IEnumerator MouseEvents_CanReceiveOnMouseDrag([ValueSource(nameof(_testDe
85
93
}
86
94
87
95
[ UnityTest ]
96
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
97
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
88
98
[ Category ( "MouseEvents" ) ]
89
- public IEnumerator MouseEvents_CanReceiveOnMouseEnterAndMouseExit ( [ ValueSource ( nameof ( _testDevicesNoTouch ) ) ] Type pointerType )
99
+ public IEnumerator MouseEvents_CanReceiveOnMouseEnterAndMouseExit ( string pointerType )
90
100
{
91
101
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
92
102
gameObject . AddComponent < OnMouseEventsTest > ( ) ;
@@ -103,8 +113,10 @@ public IEnumerator MouseEvents_CanReceiveOnMouseEnterAndMouseExit([ValueSource(n
103
113
}
104
114
105
115
[ UnityTest ]
116
+ [ TestCase ( "Pen" , ExpectedResult = null ) ]
117
+ [ TestCase ( "Mouse" , ExpectedResult = null ) ]
106
118
[ Category ( "MouseEvents" ) ]
107
- public IEnumerator MouseEvents_CanReceiveOnMouseOver ( [ ValueSource ( nameof ( _testDevicesNoTouch ) ) ] Type pointerType )
119
+ public IEnumerator MouseEvents_CanReceiveOnMouseOver ( string pointerType )
108
120
{
109
121
var gameObject = SetUpScene ( pointerType , out var pointer ) ;
110
122
gameObject . AddComponent < OnMousEventTestTwo > ( ) ;
0 commit comments