Skip to content

Commit e7cfa17

Browse files
committed
Moved testing for exception when reading a tiff to a separate test.
1 parent 54e7228 commit e7cfa17

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/Magick.NET.Tests/Coders/TheTiffCoder.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,28 @@ namespace Magick.NET.Tests;
1010

1111
public partial class TheTiffCoder
1212
{
13+
private static readonly string _tag = "32934";
14+
1315
[Fact]
14-
public void ShouldIgnoreTheSpecifiedTags()
16+
public void ShouldThrowExceptionWhenImageContainsInvalidTag()
1517
{
16-
var tag = "32934";
1718
using var image = new MagickImage();
1819

1920
var exception = Assert.Throws<MagickCoderErrorException>(() => image.Read(Files.Coders.IgnoreTagTIF));
2021

21-
Assert.Contains(tag, exception.Message);
22+
Assert.Contains(@$"Null count for ""Tag {_tag}""", exception.Message);
23+
}
2224

23-
image.Settings.SetDefine(MagickFormat.Tiff, "ignore-tags", tag);
25+
[Fact]
26+
public void ShouldIgnoreTheSpecifiedTags()
27+
{
28+
using var image = new MagickImage();
29+
image.Settings.SetDefine(MagickFormat.Tiff, "ignore-tags", _tag);
2430
image.Read(Files.Coders.IgnoreTagTIF);
2531

2632
var settings = new MagickReadSettings(new TiffReadDefines
2733
{
28-
IgnoreTags = new string[] { tag },
34+
IgnoreTags = new string[] { _tag },
2935
});
3036

3137
image.Settings.RemoveDefine(MagickFormat.Tiff, "ignore-tags");

0 commit comments

Comments
 (0)