-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored unit tests for the interlace method.
- Loading branch information
Showing
2 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
tests/Magick.NET.Tests/MagickImageTests/TheInterlaceMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System.IO; | ||
using ImageMagick; | ||
using Xunit; | ||
|
||
namespace Magick.NET.Tests | ||
{ | ||
public partial class MagickImageTests | ||
{ | ||
public class TheInterlaceMethod | ||
{ | ||
[Fact] | ||
public void ShouldUseNoInterlaceAsTheDefault() | ||
{ | ||
using (var image = new MagickImage(MagickColors.Fuchsia, 100, 60)) | ||
{ | ||
using (var memStream = new MemoryStream()) | ||
{ | ||
image.Format = MagickFormat.Jpeg; | ||
image.Write(memStream); | ||
|
||
memStream.Position = 0; | ||
image.Read(memStream); | ||
|
||
Assert.Equal(Interlace.NoInterlace, image.Interlace); | ||
} | ||
} | ||
} | ||
|
||
[Fact] | ||
public void ShouldBeUseWhenWritingJpegImage() | ||
{ | ||
using (var image = new MagickImage(MagickColors.Fuchsia, 100, 60)) | ||
{ | ||
using (var memStream = new MemoryStream()) | ||
{ | ||
image.Interlace = Interlace.Undefined; | ||
image.Write(memStream); | ||
|
||
memStream.Position = 0; | ||
image.Read(memStream); | ||
|
||
Assert.Equal(Interlace.Jpeg, image.Interlace); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters