Implement tests for MetadataRemover

This commit is contained in:
Denis-Cosmin Nutiu 2022-01-25 22:57:40 +02:00
parent 4c90086ae1
commit 292d8e0dac

View file

@ -0,0 +1,28 @@
using Image.Compressor;
using Image.Remover;
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>();
var metadataRemover = new ExifMetadataRemoverAndCompressor(magicImageMock.Object, compressorMock.Object);
// Test
metadataRemover.CleanImage("path");
// Assert
magicImageMock.Verify( i => i.RemoveProfile("exif"));
magicImageMock.Verify( i => i.Write("path"));
compressorMock.Verify( i => i.Compress("path"));
}
}
}