9
9
10
10
namespace Microsoft . Maui . DeviceTests
11
11
{
12
- public partial class BoxViewTests
13
- {
14
- MauiShapeView GetNativeBoxView ( ShapeViewHandler boxViewViewHandler ) =>
15
- boxViewViewHandler . PlatformView ;
12
+ public partial class BoxViewTests
13
+ {
14
+ MauiShapeView GetNativeBoxView ( ShapeViewHandler boxViewViewHandler ) =>
15
+ boxViewViewHandler . PlatformView ;
16
16
17
17
Task < float > GetPlatformOpacity ( ShapeViewHandler handler )
18
18
{
@@ -22,81 +22,81 @@ Task<float> GetPlatformOpacity(ShapeViewHandler handler)
22
22
return nativeView . Alpha ;
23
23
} ) ;
24
24
}
25
-
26
- [ Fact ]
27
- [ Description ( "The ScaleX property of a BoxView should match with native ScaleX" ) ]
28
- public async Task ScaleXConsistent ( )
29
- {
30
- var boxView = new BoxView ( ) { ScaleX = 0.45f } ;
31
- var expected = boxView . ScaleX ;
32
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
33
- var platformBoxView = GetNativeBoxView ( handler ) ;
34
- var platformScaleX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleX ) ;
35
- Assert . Equal ( expected , platformScaleX ) ;
36
- }
37
25
38
- [ Fact ]
39
- [ Description ( "The ScaleY property of a BoxView should match with native ScaleY" ) ]
40
- public async Task ScaleYConsistent ( )
41
- {
42
- var boxView = new BoxView ( ) { ScaleY = 1.23f } ;
43
- var expected = boxView . ScaleY ;
44
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
45
- var platformBoxView = GetNativeBoxView ( handler ) ;
46
- var platformScaleY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleY ) ;
47
- Assert . Equal ( expected , platformScaleY ) ;
48
- }
26
+ [ Fact ]
27
+ [ Description ( "The ScaleX property of a BoxView should match with native ScaleX" ) ]
28
+ public async Task ScaleXConsistent ( )
29
+ {
30
+ var boxView = new BoxView ( ) { ScaleX = 0.45f } ;
31
+ var expected = boxView . ScaleX ;
32
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
33
+ var platformBoxView = GetNativeBoxView ( handler ) ;
34
+ var platformScaleX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleX ) ;
35
+ Assert . Equal ( expected , platformScaleX ) ;
36
+ }
37
+
38
+ [ Fact ]
39
+ [ Description ( "The ScaleY property of a BoxView should match with native ScaleY" ) ]
40
+ public async Task ScaleYConsistent ( )
41
+ {
42
+ var boxView = new BoxView ( ) { ScaleY = 1.23f } ;
43
+ var expected = boxView . ScaleY ;
44
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
45
+ var platformBoxView = GetNativeBoxView ( handler ) ;
46
+ var platformScaleY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleY ) ;
47
+ Assert . Equal ( expected , platformScaleY ) ;
48
+ }
49
+
50
+ [ Fact ]
51
+ [ Description ( "The Scale property of a BoxView should match with native Scale" ) ]
52
+ public async Task ScaleConsistent ( )
53
+ {
54
+ var boxView = new BoxView ( ) { Scale = 2.0f } ;
55
+ var expected = boxView . Scale ;
56
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
57
+ var platformBoxView = GetNativeBoxView ( handler ) ;
58
+ var platformScaleX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleX ) ;
59
+ var platformScaleY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleY ) ;
60
+ Assert . Equal ( expected , platformScaleX ) ;
61
+ Assert . Equal ( expected , platformScaleY ) ;
62
+ }
49
63
50
- [ Fact ]
51
- [ Description ( "The Scale property of a BoxView should match with native Scale" ) ]
52
- public async Task ScaleConsistent ( )
53
- {
54
- var boxView = new BoxView ( ) { Scale = 2.0f } ;
55
- var expected = boxView . Scale ;
56
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
57
- var platformBoxView = GetNativeBoxView ( handler ) ;
58
- var platformScaleX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleX ) ;
59
- var platformScaleY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . ScaleY ) ;
60
- Assert . Equal ( expected , platformScaleX ) ;
61
- Assert . Equal ( expected , platformScaleY ) ;
62
- }
64
+ [ Fact ]
65
+ [ Description ( "The RotationX property of a BoxView should match with native RotationX" ) ]
66
+ public async Task RotationXConsistent ( )
67
+ {
68
+ var boxView = new BoxView ( ) { RotationX = 33.0 } ;
69
+ var expected = boxView . RotationX ;
70
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
71
+ var platformBoxView = GetNativeBoxView ( handler ) ;
72
+ var platformRotationX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . RotationX ) ;
73
+ Assert . Equal ( expected , platformRotationX ) ;
74
+ }
63
75
64
- [ Fact ]
65
- [ Description ( "The RotationX property of a BoxView should match with native RotationX " ) ]
66
- public async Task RotationXConsistent ( )
67
- {
68
- var boxView = new BoxView ( ) { RotationX = 33 .0 } ;
69
- var expected = boxView . RotationX ;
70
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
71
- var platformBoxView = GetNativeBoxView ( handler ) ;
72
- var platformRotationX = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . RotationX ) ;
73
- Assert . Equal ( expected , platformRotationX ) ;
74
- }
76
+ [ Fact ]
77
+ [ Description ( "The RotationY property of a BoxView should match with native RotationY " ) ]
78
+ public async Task RotationYConsistent ( )
79
+ {
80
+ var boxView = new BoxView ( ) { RotationY = 87 .0 } ;
81
+ var expected = boxView . RotationY ;
82
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
83
+ var platformBoxView = GetNativeBoxView ( handler ) ;
84
+ var platformRotationY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . RotationY ) ;
85
+ Assert . Equal ( expected , platformRotationY ) ;
86
+ }
75
87
76
- [ Fact ]
77
- [ Description ( "The RotationY property of a BoxView should match with native RotationY " ) ]
78
- public async Task RotationYConsistent ( )
79
- {
80
- var boxView = new BoxView ( ) { RotationY = 87 .0 } ;
81
- var expected = boxView . RotationY ;
82
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
83
- var platformBoxView = GetNativeBoxView ( handler ) ;
84
- var platformRotationY = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . RotationY ) ;
85
- Assert . Equal ( expected , platformRotationY ) ;
86
- }
88
+ [ Fact ]
89
+ [ Description ( "The Rotation property of a BoxView should match with native Rotation " ) ]
90
+ public async Task RotationConsistent ( )
91
+ {
92
+ var boxView = new BoxView ( ) { Rotation = 23 .0 } ;
93
+ var expected = boxView . Rotation ;
94
+ var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
95
+ var platformBoxView = GetNativeBoxView ( handler ) ;
96
+ var platformRotation = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . Rotation ) ;
97
+ Assert . Equal ( expected , platformRotation ) ;
98
+ }
87
99
88
- [ Fact ]
89
- [ Description ( "The Rotation property of a BoxView should match with native Rotation" ) ]
90
- public async Task RotationConsistent ( )
91
- {
92
- var boxView = new BoxView ( ) { Rotation = 23.0 } ;
93
- var expected = boxView . Rotation ;
94
- var handler = await CreateHandlerAsync < ShapeViewHandler > ( boxView ) ;
95
- var platformBoxView = GetNativeBoxView ( handler ) ;
96
- var platformRotation = await InvokeOnMainThreadAsync ( ( ) => platformBoxView . Rotation ) ;
97
- Assert . Equal ( expected , platformRotation ) ;
98
- }
99
-
100
100
Task < bool > GetPlatformIsVisible ( ShapeViewHandler boxViewViewHandler )
101
101
{
102
102
return InvokeOnMainThreadAsync ( ( ) =>
0 commit comments