1-
2- using System ;
1+ using System ;
32using System . Collections . Generic ;
43using System . Linq ;
54using System . Threading . Tasks ;
@@ -20,6 +19,7 @@ private static ErgodoxLayout InitializeDataTree()
2019 HashId = "" ,
2120 Revisions = new List < Revision > {
2221 new Revision {
22+ HashId = "hashId-1" ,
2323 Layers = new List < ErgodoxLayer > {
2424 new ErgodoxLayer ( ) {
2525 Color = "" ,
@@ -45,8 +45,14 @@ public async Task GetLayoutInfo(string layoutHashId, bool exist)
4545 // Act
4646 ErgodoxLayout response = null ;
4747
48- if ( exist ) { response = await layoutService . GetLayoutInfo ( layoutHashId ) ; }
49- else { await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetLayoutInfo ( layoutHashId ) ) ; }
48+ if ( exist )
49+ {
50+ response = await layoutService . GetLayoutInfo ( layoutHashId ) ;
51+ }
52+ else
53+ {
54+ await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetLayoutInfo ( layoutHashId ) ) ;
55+ }
5056
5157 // Assert
5258 if ( exist )
@@ -71,8 +77,14 @@ public async Task GetErgodoxLayout(string layoutHashId, bool exist)
7177 // Act
7278 ErgodoxLayout response = null ;
7379
74- if ( exist ) { response = await layoutService . GetErgodoxLayout ( layoutHashId ) ; }
75- else { await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetErgodoxLayout ( layoutHashId ) ) ; }
80+ if ( exist )
81+ {
82+ response = await layoutService . GetErgodoxLayout ( layoutHashId ) ;
83+ }
84+ else
85+ {
86+ await Assert . ThrowsAsync < ArgumentException > ( ( ) => layoutService . GetErgodoxLayout ( layoutHashId ) ) ;
87+ }
7688
7789 // Assert
7890 if ( exist )
@@ -107,7 +119,7 @@ public void PrepareEZLayout_OneLayer_ManyKeys()
107119 EZLayout ezLayoutResult ;
108120
109121 // Act
110- ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
122+ ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout , ergodoxLayout . Revisions . First ( ) . HashId ) ;
111123
112124 // Assert
113125 Assert . Single ( ezLayoutResult . EZLayers ) ;
@@ -161,7 +173,7 @@ public void PrepareEZLayout_TwoLayer_ManyKeys()
161173 EZLayout ezLayoutResult ;
162174
163175 // Act
164- ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout ) ;
176+ ezLayoutResult = layoutService . PrepareEZLayout ( ergodoxLayout , ergodoxLayout . Revisions . First ( ) . HashId ) ;
165177
166178 // Assert
167179 Assert . Equal ( 2 , ezLayoutResult . EZLayers . Count ) ;
@@ -183,7 +195,7 @@ public void PrepareEZLayout_TwoLayer_ManyKeys()
183195 Assert . Equal ( KeyCategory . Spacing , layer1KeyResults [ 1 ] . KeyCategory ) ;
184196 }
185197
186- [ Fact ]
198+ [ Fact ]
187199 public async Task GetErgodoxLayout_HashIdNull ( )
188200 {
189201 // Arrange
0 commit comments