1
1
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
2
2
// Licensed under the Apache License, Version 2.0.
3
3
4
+ using System ;
5
+ using System . Linq ;
4
6
using ImageMagick ;
5
7
using ImageMagick . Formats ;
6
8
using Xunit ;
@@ -11,18 +13,27 @@ public partial class HeicReadDefinesTests
11
13
{
12
14
public class TheChromaUpsamplingProperty
13
15
{
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 ( )
18
18
{
19
- using var image = new MagickImage ( ) ;
20
- image . Settings . SetDefines ( new HeicReadDefines
19
+ foreach ( var value in Enum . GetValues ( typeof ( HeicChromaUpsampling ) ) . OfType < HeicChromaUpsampling > ( ) )
21
20
{
22
- ChromaUpsampling = chromaUpsampling ,
23
- } ) ;
21
+ using var image = new MagickImage ( ) ;
22
+ image . Settings . SetDefines ( new HeicReadDefines
23
+ {
24
+ ChromaUpsampling = value ,
25
+ } ) ;
24
26
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
+ }
26
37
}
27
38
28
39
[ Fact ]
0 commit comments