ImgMetadataRemover/ImageCore.Tests/TestMetadataRemover.cs

27 lines
764 B
C#
Raw Normal View History

using Image.Core;
2022-01-25 20:57:40 +00:00
using ImageMagick;
using Moq;
using Xunit;
namespace ImageCore.Tests
{
public class TestMetadataRemover
{
[Fact]
public void TestCleanImage()
{
// Setup
var magicImageMock = new Mock<IMagickImage>();
var compressorMock = new Mock<ICompressor>();
2022-02-12 20:12:57 +00:00
var metadataRemover = new ExifRemoverAndCompressor(magicImageMock.Object, compressorMock.Object);
2022-01-25 20:57:40 +00:00
// Test
metadataRemover.CleanImage("path");
// Assert
magicImageMock.Verify( i => i.RemoveProfile("exif"));
magicImageMock.Verify( i => i.Write("path"));
compressorMock.Verify( i => i.Compress("path"));
}
}
}