ImgMetadataRemover/ImageCore.Tests/TestMetadataRemover.cs

28 lines
799 B
C#
Raw Normal View History

2022-01-25 20:57:40 +00:00
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"));
}
}
}