Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

Commit 14f1ecf

Browse files
committed
Fix unit tests
1 parent e5d56ca commit 14f1ecf

File tree

3 files changed

+51
-50
lines changed

3 files changed

+51
-50
lines changed

src/InvvardDev.EZLayoutDisplay.Tests/Helper/EZLayoutMakerTest.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void PrepareEZLayout_InitializeEZLayout(string expectedTitle, string expe
3434

3535
// Act
3636
var ezLayoutMaker = new EZLayoutMaker();
37-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
37+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
3838

3939
// Assert
4040
Assert.Equal(expectedTitle, ezLayoutResult.Name);
@@ -56,7 +56,7 @@ public void PrepareEZLayout_InitializeEZLayer(int expectedIndex, string expected
5656

5757
// Act
5858
var ezLayoutMaker = new EZLayoutMaker();
59-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
59+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
6060

6161
// Assert
6262
Assert.Single(ezLayoutResult.EZLayers);
@@ -86,7 +86,7 @@ public void PrepareEZLayout_ColorKey(string layerColor, string keyColor, string
8686

8787
// Act
8888
var ezLayoutMaker = new EZLayoutMaker();
89-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
89+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
9090

9191
// Assert
9292
Assert.Equal(expectedColor, ezLayoutResult.EZLayers.First().EZKeys.First().Color);
@@ -104,7 +104,7 @@ public void PrepareEZLayout_KeyCodeUnknown()
104104

105105
// Act
106106
var ezLayoutMaker = new EZLayoutMaker();
107-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
107+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
108108

109109
// Assert
110110
Assert.Single(ezLayoutResult.EZLayers);
@@ -126,7 +126,7 @@ public void PrepareEZLayout_InitializeEZKey(string expectedKeyCode, string expec
126126

127127
// Act
128128
var ezLayoutMaker = new EZLayoutMaker();
129-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
129+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
130130

131131
// Assert
132132
Assert.Single(ezLayoutResult.EZLayers);
@@ -162,7 +162,7 @@ public void PrepareEZLayout_KeyCategoryWithSimpleLabel(string keyCode, string ex
162162

163163
// Act
164164
var ezLayoutMaker = new EZLayoutMaker();
165-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
165+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
166166

167167
// Assert
168168
Assert.Single(ezLayoutResult.EZLayers);
@@ -188,7 +188,7 @@ public void PrepareEZLayout_KeyCategoryOSM(string keyCode, string command, strin
188188

189189
// Act
190190
var ezLayoutMaker = new EZLayoutMaker();
191-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
191+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
192192

193193
// Assert
194194
Assert.Single(ezLayoutResult.EZLayers);
@@ -228,7 +228,7 @@ public void PrepareEZLayout_KeyCategoryLayer(string keyCode, string expectedLabe
228228

229229
// Act
230230
var ezLayoutMaker = new EZLayoutMaker();
231-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
231+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
232232

233233
// Assert
234234
Assert.Single(ezLayoutResult.EZLayers);
@@ -257,7 +257,7 @@ public void PrepareEZLayout_KeyCategoryLayerShortcut(string keyCode,
257257

258258
// Act
259259
var ezLayoutMaker = new EZLayoutMaker();
260-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
260+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
261261

262262
// Assert
263263
Assert.Single(ezLayoutResult.EZLayers);
@@ -299,7 +299,7 @@ public void PrepareEZLayout_KeyCategoryWithGlyphs(string keyCode, string expecte
299299

300300
// Act
301301
var ezLayoutMaker = new EZLayoutMaker();
302-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
302+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
303303

304304
// Assert
305305
Assert.Single(ezLayoutResult.EZLayers);
@@ -330,7 +330,7 @@ public void PrepareEZLayout_KeyCategoryDualFunction(string keyCode,
330330

331331
// Act
332332
var ezLayoutMaker = new EZLayoutMaker();
333-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
333+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
334334

335335
// Assert
336336
Assert.Single(ezLayoutResult.EZLayers);
@@ -364,7 +364,7 @@ public void PrepareEZLayout_KeyCategoryShortcuts(string keyCode, string command,
364364

365365
// Act
366366
var ezLayoutMaker = new EZLayoutMaker();
367-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
367+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
368368

369369
// Assert
370370
Assert.Single(ezLayoutResult.EZLayers);
@@ -433,7 +433,7 @@ public void PrepareEZLayout_ProcessModifiers(bool leftAlt,
433433

434434
// Act
435435
var ezLayoutMaker = new EZLayoutMaker();
436-
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout, HashId);
436+
ezLayoutResult = ezLayoutMaker.PrepareEZLayout(ergodoxLayout);
437437

438438
// Assert
439439
Assert.Single(ezLayoutResult.EZLayers);

src/InvvardDev.EZLayoutDisplay.Tests/Service/LayoutServiceTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public async Task GetLayoutInfo(string layoutHashId, bool exist)
4545

4646
if (exist)
4747
{
48-
response = await layoutService.GetLayoutInfo(layoutHashId);
48+
response = await layoutService.GetLayoutInfo(layoutHashId, "latest");
4949
}
5050
else
5151
{
52-
await Assert.ThrowsAsync<ArgumentException>(() => layoutService.GetLayoutInfo(layoutHashId));
52+
await Assert.ThrowsAsync<ArgumentException>(() => layoutService.GetLayoutInfo(layoutHashId, "latest"));
5353
}
5454

5555
// Assert
@@ -77,11 +77,11 @@ public async Task GetErgodoxLayout(string layoutHashId, bool exist)
7777

7878
if (exist)
7979
{
80-
response = await layoutService.GetErgodoxLayout(layoutHashId);
80+
response = await layoutService.GetErgodoxLayout(layoutHashId, "latest");
8181
}
8282
else
8383
{
84-
await Assert.ThrowsAsync<ArgumentException>(() => layoutService.GetErgodoxLayout(layoutHashId));
84+
await Assert.ThrowsAsync<ArgumentException>(() => layoutService.GetErgodoxLayout(layoutHashId, "latest"));
8585
}
8686

8787
// Assert
@@ -117,7 +117,7 @@ public void PrepareEZLayout_OneLayer_ManyKeys()
117117
EZLayout ezLayoutResult;
118118

119119
// Act
120-
ezLayoutResult = layoutService.PrepareEZLayout(ergodoxLayout, ergodoxLayout.Revision.HashId);
120+
ezLayoutResult = layoutService.PrepareEZLayout(ergodoxLayout);
121121

122122
// Assert
123123
Assert.Single(ezLayoutResult.EZLayers);
@@ -171,7 +171,7 @@ public void PrepareEZLayout_TwoLayer_ManyKeys()
171171
EZLayout ezLayoutResult;
172172

173173
// Act
174-
ezLayoutResult = layoutService.PrepareEZLayout(ergodoxLayout, ergodoxLayout.Revision.HashId);
174+
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
}

0 commit comments

Comments
 (0)