1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Threading . Tasks ;
5- using InvvardDev . EZLayoutDisplay . Desktop . Model ;
1+ using InvvardDev . EZLayoutDisplay . Desktop . Model ;
62using InvvardDev . EZLayoutDisplay . Desktop . Model . Enum ;
73using InvvardDev . EZLayoutDisplay . Desktop . Service . Implementation ;
84using InvvardDev . EZLayoutDisplay . Desktop . Service . Interface ;
5+ using System ;
6+ using System . Collections . Generic ;
7+ using System . Linq ;
8+ using System . Threading . Tasks ;
99using Xunit ;
1010
1111namespace InvvardDev . EZLayoutDisplay . Tests . Service
@@ -32,24 +32,25 @@ private static ErgodoxLayout InitializeDataTree()
3232 }
3333
3434 [ Theory ]
35- [ InlineData ( "EOEb" , true ) ]
36- [ InlineData ( "default" , true ) ]
37- [ InlineData ( "test" , false ) ]
38- public async Task GetLayoutInfo ( string layoutHashId , bool exist )
35+ [ InlineData ( "EOEb" , "ergodox-ez" , "ergodox-ez" , true ) ]
36+ [ InlineData ( "EOEb" , "planck-ez" , "ergodox-ez" , true ) ]
37+ [ InlineData ( "default" , "ergodox-ez" , "ergodox-ez" , true ) ]
38+ [ InlineData ( "default" , "moonlander" , "moonlander" , true ) ]
39+ [ InlineData ( "test" , "ergodox-ez" , "ergodox-ez" , false ) ]
40+ public async Task GetLayoutInfo ( string layoutHashId , string geometry , string expectedGeometry , bool exist )
3941 {
4042 // Arrange
4143 ILayoutService layoutService = new LayoutService ( ) ;
42-
43- // Act
4444 ErgodoxLayout response = null ;
4545
46+ // Act
4647 if ( exist )
4748 {
48- response = await layoutService . GetLayoutInfo ( layoutHashId , "latest" ) ;
49+ response = await layoutService . GetLayoutInfo ( layoutHashId , geometry , "latest" ) ;
4950 }
5051 else
5152 {
52- await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetLayoutInfo ( layoutHashId , "latest" ) ) ;
53+ await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetLayoutInfo ( layoutHashId , geometry , "latest" ) ) ;
5354 }
5455
5556 // Assert
@@ -60,6 +61,7 @@ public async Task GetLayoutInfo(string layoutHashId, bool exist)
6061 Assert . NotNull ( response . Revision ) ;
6162 Assert . False ( string . IsNullOrWhiteSpace ( response . HashId ) ) ;
6263 Assert . False ( string . IsNullOrWhiteSpace ( response . Title ) ) ;
64+ Assert . Equal ( expectedGeometry , response . Geometry ) ;
6365 }
6466 }
6567
@@ -77,11 +79,11 @@ public async Task GetErgodoxLayout(string layoutHashId, bool exist)
7779
7880 if ( exist )
7981 {
80- response = await layoutService . GetErgodoxLayout ( layoutHashId , "latest" ) ;
82+ response = await layoutService . GetErgodoxLayout ( layoutHashId , "ergodox-ez" , " latest") ;
8183 }
8284 else
8385 {
84- await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetErgodoxLayout ( layoutHashId , "latest" ) ) ;
86+ await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetErgodoxLayout ( layoutHashId , "ergodox-ez" , " latest") ) ;
8587 }
8688
8789 // Assert
@@ -114,10 +116,9 @@ public void PrepareEZLayout_OneLayer_ManyKeys()
114116 GlowColor = "" ,
115117 Code = "KC_TRANSPARENT"
116118 } ) ;
117- EZLayout ezLayoutResult ;
118119
119120 // Act
120- ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
121+ var ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
121122
122123 // Assert
123124 Assert . Single ( ezLayoutResult . EZLayers ) ;
@@ -168,10 +169,9 @@ public void PrepareEZLayout_TwoLayer_ManyKeys()
168169 GlowColor = "" ,
169170 Code = "KC_SPACE"
170171 } ) ;
171- EZLayout ezLayoutResult ;
172172
173173 // Act
174- ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
174+ var ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
175175
176176 // Assert
177177 Assert . Equal ( 2 , ezLayoutResult . EZLayers . Count ) ;
@@ -200,7 +200,7 @@ public async Task GetErgodoxLayout_HashIdNull()
200200 ILayoutService layoutService = new LayoutService ( ) ;
201201
202202 // Act
203- await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => layoutService . GetErgodoxLayout ( "" , "" ) ) ;
203+ await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => layoutService . GetErgodoxLayout ( "" , "" , "" ) ) ;
204204 }
205205
206206 [ Theory ]
0 commit comments