Implement tests for MetadataRemover
This commit is contained in:
parent
4c90086ae1
commit
292d8e0dac
1 changed files with 28 additions and 0 deletions
28
ImageCore.Tests/TestMetadataRemover.cs
Normal file
28
ImageCore.Tests/TestMetadataRemover.cs
Normal 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"));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue