File tree 1 file changed +35
-2
lines changed
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms
1 file changed +35
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
#nullable enable
5
5
6
+ using System . Reflection ;
7
+
6
8
namespace System . Windows . Forms ;
7
9
8
10
public class FocusableLabelTests
9
11
{
10
12
[ Fact ]
11
- public void UnderlineWhenFocused_DefaultValue_ShouldBeTrue ( )
13
+ public void UnderlineWhenFocused_ShouldBeTrue ( )
12
14
{
13
15
using FocusableLabel label = new ( ) ;
14
16
15
17
label . UnderlineWhenFocused . Should ( ) . BeTrue ( ) ;
16
18
}
17
19
18
20
[ Fact ]
19
- public void FocusableLabel_ShouldBeSelectableAndTabStop ( )
21
+ public void UnderlineWhenFocused_SetToFalse_ShouldBeFalse ( )
22
+ {
23
+ using FocusableLabel label = new ( ) ;
24
+
25
+ label . UnderlineWhenFocused = false ;
26
+
27
+ label . UnderlineWhenFocused . Should ( ) . BeFalse ( ) ;
28
+ }
29
+
30
+ [ Fact ]
31
+ public void CreateParams_ClassName_ShouldBeNull ( )
32
+ {
33
+ using FocusableLabel label = new ( ) ;
34
+
35
+ var createParams = GetCreateParams ( label ) ;
36
+
37
+ createParams . Should ( ) . NotBeNull ( ) ;
38
+
39
+ var className = createParams ? . GetType ( ) . GetProperty ( "ClassName" ) ? . GetValue ( createParams ) ;
40
+
41
+ className . Should ( ) . BeNull ( ) ;
42
+ }
43
+
44
+ private static object ? GetCreateParams ( Control control )
45
+ {
46
+ return typeof ( Control )
47
+ . GetProperty ( "CreateParams" , BindingFlags . NonPublic | BindingFlags . Instance ) ?
48
+ . GetValue ( control ) ;
49
+ }
50
+
51
+ [ Fact ]
52
+ public void TabStop_ShouldBeTrue ( )
20
53
{
21
54
using FocusableLabel label = new ( ) ;
22
55
You can’t perform that action at this time.
0 commit comments