Skip to content

Commit 6cadbfe

Browse files
committed
Improve test for when new values are added.
1 parent fa25c05 commit 6cadbfe

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

tests/Magick.NET.Tests/Formats/Heic/HeicReadDefinesTests/TheChromaUpsamplingProperty.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
22
// Licensed under the Apache License, Version 2.0.
33

4+
using System;
5+
using System.Linq;
46
using ImageMagick;
57
using ImageMagick.Formats;
68
using Xunit;
@@ -11,18 +13,27 @@ public partial class HeicReadDefinesTests
1113
{
1214
public class TheChromaUpsamplingProperty
1315
{
14-
[Theory]
15-
[InlineData(HeicChromaUpsampling.Bilinear, "bilinear")]
16-
[InlineData(HeicChromaUpsampling.NearestNeighbor, "nearest-neighbor")]
17-
public void ShouldSetTheDefine(HeicChromaUpsampling chromaUpsampling, string excpeted)
16+
[Fact]
17+
public void ShouldSetTheDefine()
1818
{
19-
using var image = new MagickImage();
20-
image.Settings.SetDefines(new HeicReadDefines
19+
foreach (var value in Enum.GetValues(typeof(HeicChromaUpsampling)).OfType<HeicChromaUpsampling>())
2120
{
22-
ChromaUpsampling = chromaUpsampling,
23-
});
21+
using var image = new MagickImage();
22+
image.Settings.SetDefines(new HeicReadDefines
23+
{
24+
ChromaUpsampling = value,
25+
});
2426

25-
Assert.Equal(excpeted, image.Settings.GetDefine(MagickFormat.Heic, "chroma-upsampling"));
27+
switch (value)
28+
{
29+
case HeicChromaUpsampling.Bilinear:
30+
Assert.Equal("bilinear", image.Settings.GetDefine(MagickFormat.Heic, "chroma-upsampling"));
31+
break;
32+
case HeicChromaUpsampling.NearestNeighbor:
33+
Assert.Equal("nearest-neighbor", image.Settings.GetDefine(MagickFormat.Heic, "chroma-upsampling"));
34+
break;
35+
}
36+
}
2637
}
2738

2839
[Fact]

0 commit comments

Comments
 (0)