@@ -22,9 +22,9 @@ void Inspect(FrameworkElement tree)
22
22
var hasContentElementInPath = TestData . HasContentElementWithin ( xaml ) ;
23
23
24
24
// Build generic methods manually, since the type to seek might change for each data set:
25
- var methodInfo = typeof ( WPFVisualFinders ) . GetMethod ( "FindChild" ) ;
25
+ var methodInfo = typeof ( WpfVisualFinders ) . GetMethod ( "FindChild" ) ;
26
26
var method = methodInfo ? . MakeGenericMethod ( expected . GetType ( ) ) ;
27
- var extMethodInfo = typeof ( WPFVisualFindersExtensions ) . GetMethod ( "FindChild" ) ;
27
+ var extMethodInfo = typeof ( WpfVisualFindersExtensions ) . GetMethod ( "FindChild" ) ;
28
28
var extMethod = extMethodInfo ? . MakeGenericMethod ( expected . GetType ( ) ) ;
29
29
30
30
// Test unnamed:
@@ -59,7 +59,7 @@ void Inspect(FrameworkElement tree)
59
59
Assert . Same ( namedResult , regexExtensionResult ) ;
60
60
}
61
61
62
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
62
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
63
63
}
64
64
#endregion
65
65
@@ -76,7 +76,7 @@ void Inspect(FrameworkElement tree)
76
76
var hasContentElementInPath = TestData . HasContentElementWithin ( xaml ) ;
77
77
78
78
// Test unnamed:
79
- var result = WPFVisualFinders . FindChildByType ( origin , expected . GetType ( ) , allowContentElements : allowContentElements ) ;
79
+ var result = WpfVisualFinders . FindChildByType ( origin , expected . GetType ( ) , allowContentElements : allowContentElements ) ;
80
80
if ( relatedInPath && ( allowContentElements || ! hasContentElementInPath ) )
81
81
{
82
82
if ( ! hasSimilarTypeInPath ) // should find destination if not caught a similar type.
@@ -91,13 +91,13 @@ void Inspect(FrameworkElement tree)
91
91
Assert . Same ( result , extensionResult ) ;
92
92
93
93
// Test named:
94
- var namedResult = WPFVisualFinders . FindChildByType ( origin , expected . GetType ( ) , "End" , allowContentElements ) ;
94
+ var namedResult = WpfVisualFinders . FindChildByType ( origin , expected . GetType ( ) , "End" , allowContentElements ) ;
95
95
if ( relatedInPath && ( allowContentElements || ! hasContentElementInPath ) ) // should always find if related in path
96
96
Assert . Same ( expected , namedResult ) ;
97
97
else Assert . Null ( namedResult ) ;
98
98
99
99
// Test with regex:
100
- var regexResult = WPFVisualFinders . FindChildByType ( origin , expected . GetType ( ) , @"E[a-z]\D{1}" , allowContentElements ) ;
100
+ var regexResult = WpfVisualFinders . FindChildByType ( origin , expected . GetType ( ) , @"E[a-z]\D{1}" , allowContentElements ) ;
101
101
Assert . Same ( namedResult , regexResult ) ;
102
102
103
103
// Test extension method with named target and regex:
@@ -107,7 +107,7 @@ void Inspect(FrameworkElement tree)
107
107
Assert . Same ( namedResult , regexExtensionResult ) ;
108
108
}
109
109
110
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
110
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
111
111
}
112
112
#endregion
113
113
@@ -127,9 +127,9 @@ void Inspect(FrameworkElement tree)
127
127
var hasContentElementInPath = TestData . HasContentElementWithin ( xaml ) ;
128
128
129
129
// Build generic methods manually, since the type to seek might change for each data set:
130
- var methodInfo = typeof ( WPFVisualFinders ) . GetMethod ( "FindDirectChild" ) ;
130
+ var methodInfo = typeof ( WpfVisualFinders ) . GetMethod ( "FindDirectChild" ) ;
131
131
var method = methodInfo ? . MakeGenericMethod ( expected . GetType ( ) ) ;
132
- var extMethodInfo = typeof ( WPFVisualFindersExtensions ) . GetMethod ( "FindDirectChild" ) ;
132
+ var extMethodInfo = typeof ( WpfVisualFindersExtensions ) . GetMethod ( "FindDirectChild" ) ;
133
133
var extMethod = extMethodInfo ? . MakeGenericMethod ( expected . GetType ( ) ) ;
134
134
135
135
// Test unnamed:
@@ -161,7 +161,7 @@ void Inspect(FrameworkElement tree)
161
161
Assert . Same ( namedResult , regexExtensionResult ) ;
162
162
}
163
163
164
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
164
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
165
165
}
166
166
#endregion
167
167
@@ -181,7 +181,7 @@ void Inspect(FrameworkElement tree)
181
181
var hasContentElementInPath = TestData . HasContentElementWithin ( xaml ) ;
182
182
183
183
// Test unnamed:
184
- var result = WPFVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , allowContentElements : allowContentElements ) ;
184
+ var result = WpfVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , allowContentElements : allowContentElements ) ;
185
185
if ( hasSimilarTypeInDirectPath && ( allowContentElements || ! hasContentElementInPath ) ) // here if caught an intermediary node
186
186
Assert . Equal ( expected . GetType ( ) , result ? . GetType ( ) ) ;
187
187
else if ( inDirectPath && ( allowContentElements || ! hasContentElementInPath ) ) // should find destination if not caught a similar type.
@@ -193,13 +193,13 @@ void Inspect(FrameworkElement tree)
193
193
Assert . Same ( result , extensionResult ) ;
194
194
195
195
// Test named:
196
- var namedResult = WPFVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , "End" , allowContentElements ) ;
196
+ var namedResult = WpfVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , "End" , allowContentElements ) ;
197
197
if ( inDirectPath && ( allowContentElements || ! hasContentElementInPath ) ) // should always find if related in path
198
198
Assert . Same ( expected , namedResult ) ;
199
199
else Assert . Null ( namedResult ) ;
200
200
201
201
// Test with regex:
202
- var regexResult = WPFVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , @"E[a-z]\D{1}" , allowContentElements ) ;
202
+ var regexResult = WpfVisualFinders . FindDirectChildByType ( origin , expected . GetType ( ) , @"E[a-z]\D{1}" , allowContentElements ) ;
203
203
Assert . Same ( namedResult , regexResult ) ;
204
204
205
205
// Test extension method with named target and regex:
@@ -209,7 +209,7 @@ void Inspect(FrameworkElement tree)
209
209
Assert . Same ( namedResult , regexExtensionResult ) ;
210
210
}
211
211
212
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
212
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
213
213
}
214
214
#endregion
215
215
@@ -242,9 +242,9 @@ void Inspect(FrameworkElement tree)
242
242
x is FrameworkContentElement asFce && Regex . IsMatch ( asFce . Name , ".*[A-Z]ibling.*" ) ) ;
243
243
244
244
// Build generic methods manually, since the type to seek might change for each data set:
245
- var methodInfo = typeof ( WPFVisualFinders ) . GetMethod ( "FindAllChildren" ) ;
245
+ var methodInfo = typeof ( WpfVisualFinders ) . GetMethod ( "FindAllChildren" ) ;
246
246
var method = methodInfo ? . MakeGenericMethod ( targetType ) ;
247
- var extMethodInfo = typeof ( WPFVisualFindersExtensions ) . GetMethod ( "FindAllChildren" ) ;
247
+ var extMethodInfo = typeof ( WpfVisualFindersExtensions ) . GetMethod ( "FindAllChildren" ) ;
248
248
var extMethod = extMethodInfo ? . MakeGenericMethod ( targetType ) ;
249
249
250
250
// Test unnamed:
@@ -272,15 +272,15 @@ void Inspect(FrameworkElement tree)
272
272
Assert . Equal ( result , extensionResult ) ;
273
273
274
274
// Test regex pattern on similar types named "SimilarSiblings":
275
- result = WPFVisualFinders . FindAllChildrenByType ( origin , targetType , ".*[A-Z]ibling.*" , allowContentElements ) ;
275
+ result = WpfVisualFinders . FindAllChildrenByType ( origin , targetType , ".*[A-Z]ibling.*" , allowContentElements ) ;
276
276
Assert . Equal ( expectedRegex , result ) ;
277
277
278
278
// Test extension with regex pattern:
279
279
extensionResult = origin . FindAllChildrenByType ( targetType , ".*[A-Z]ibling.*" , allowContentElements ) ;
280
280
Assert . Equal ( result , extensionResult ) ;
281
281
}
282
282
283
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
283
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
284
284
}
285
285
#endregion
286
286
@@ -310,7 +310,7 @@ void Inspect(FrameworkElement tree)
310
310
x is FrameworkContentElement asFce && Regex . IsMatch ( asFce . Name , ".*[A-Z]ibling.*" ) ) ;
311
311
312
312
// Test unnamed:
313
- var result = WPFVisualFinders . FindAllChildrenByType ( origin , targetType , allowContentElements : allowContentElements ) . ToArray ( ) ;
313
+ var result = WpfVisualFinders . FindAllChildrenByType ( origin , targetType , allowContentElements : allowContentElements ) . ToArray ( ) ;
314
314
Assert . Equal ( expected , result ) ;
315
315
if ( relatedInPath && ( allowContentElements || ! hasContentElementInPath ) )
316
316
Assert . Contains ( expectedSpecificItem , result ) ;
@@ -321,7 +321,7 @@ void Inspect(FrameworkElement tree)
321
321
Assert . Equal ( result , extensionResult ) ;
322
322
323
323
// Test named:
324
- result = WPFVisualFinders . FindAllChildrenByType ( origin , targetType , "End" , allowContentElements ) . ToArray ( ) ;
324
+ result = WpfVisualFinders . FindAllChildrenByType ( origin , targetType , "End" , allowContentElements ) . ToArray ( ) ;
325
325
Assert . Equal ( expectedNamed , result ) ;
326
326
if ( relatedInPath && ( allowContentElements || ! hasContentElementInPath ) )
327
327
Assert . Contains ( expectedSpecificItem , result ) ;
@@ -332,15 +332,15 @@ void Inspect(FrameworkElement tree)
332
332
Assert . Equal ( result , extensionResult ) ;
333
333
334
334
// Test regex pattern on similar types named "SameSibling":
335
- result = WPFVisualFinders . FindAllChildrenByType ( origin , targetType , ".*[A-Z]ibling.*" , allowContentElements ) . ToArray ( ) ;
335
+ result = WpfVisualFinders . FindAllChildrenByType ( origin , targetType , ".*[A-Z]ibling.*" , allowContentElements ) . ToArray ( ) ;
336
336
Assert . Equal ( expectedRegex , result ) ;
337
337
338
338
// Test extension with regex pattern:
339
339
extensionResult = origin . FindAllChildrenByType ( targetType , ".*[A-Z]ibling.*" , allowContentElements ) ;
340
340
Assert . Equal ( result , extensionResult ) ;
341
341
}
342
342
343
- WPFAppTester . RunTestInWindow ( Inspect , xaml ) ;
343
+ WpfAppTester . RunTestInWindow ( Inspect , xaml ) ;
344
344
}
345
345
#endregion
346
346
}
0 commit comments