ImgMetadataRemover/ImageCore.Tests/TestKeepFilenameFormatter.cs

28 lines
841 B
C#
Raw Normal View History

using System;
using Image.Files;
using Xunit;
namespace ImageCore.Tests
{
2022-02-12 20:12:57 +00:00
public class TestSimpleOutputSink
{
[Theory]
[InlineData("", "./", @".\.jpg")]
[InlineData("", @".\", @".\.jpg")]
[InlineData("", "asd", @".\asd.jpg")]
[InlineData("dir", "asd", @"dir\asd.jpg")]
public void TestGetOutputPath(string directory, string file, string expectedPath)
{
2022-02-12 20:12:57 +00:00
var outputPathFormatter = SimpleOutputSink.Create(directory);
Assert.Equal(expectedPath, outputPathFormatter.GetOutputPath(file));
}
[Fact]
public void TestGetOutputPathNull()
{
2022-02-12 20:12:57 +00:00
var outputPathFormatter = SimpleOutputSink.Create("directory");
Assert.Throws<ArgumentException>(() => outputPathFormatter.GetOutputPath(""));
}
}
}