Skip to content

Commit 4d79243

Browse files
committed
improve tests
1 parent 81ad184 commit 4d79243

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public async Task ApiEndToEndWithArchiveWritingAndLoad()
181181

182182
private void CheckForDockerTarballStructure(string tarball)
183183
{
184-
var layers = new HashSet<string>();
184+
var layersCount = 0;
185185
int configJson = 0;
186186
int manifestJsonCount = 0;
187187

@@ -202,7 +202,7 @@ private void CheckForDockerTarballStructure(string tarball)
202202
}
203203
else if (entry.Name.EndsWith("/layer.tar"))
204204
{
205-
layers.Add(entry.Name);
205+
layersCount++;
206206
}
207207
else
208208
{
@@ -215,7 +215,7 @@ private void CheckForDockerTarballStructure(string tarball)
215215

216216
Assert.Equal(1, manifestJsonCount);
217217
Assert.Equal(1, configJson);
218-
Assert.NotEmpty(layers);
218+
Assert.True(layersCount > 0);
219219
}
220220

221221
[DockerAvailableFact]
@@ -269,7 +269,7 @@ public async Task ApiEndToEndOciImageWithArchiveWritingAndLoad()
269269

270270
private void CheckForOciTarballStructure(string tarball)
271271
{
272-
var blobs = new HashSet<string>();
272+
int blobsCount = 0;
273273
int ociLayoutCount = 0;
274274
int indexJsonCount = 0;
275275

@@ -290,7 +290,7 @@ private void CheckForOciTarballStructure(string tarball)
290290
}
291291
else if (entry.Name.StartsWith("blobs/sha256/"))
292292
{
293-
blobs.Add(entry.Name);
293+
blobsCount++;
294294
}
295295
else
296296
{
@@ -303,7 +303,7 @@ private void CheckForOciTarballStructure(string tarball)
303303

304304
Assert.Equal(1, ociLayoutCount);
305305
Assert.Equal(1, indexJsonCount);
306-
Assert.NotEmpty(blobs);
306+
Assert.True(blobsCount > 0);
307307
}
308308

309309
private string BuildLocalApp([CallerMemberName] string testName = "TestName", string tfm = ToolsetInfo.CurrentTargetFramework, string rid = "linux-x64")

0 commit comments

Comments
 (0)