ImgMetadataRemover/ImageCore.Tests/TestKeepFilenameFormatter.cs

28 lines
875 B
C#
Raw Normal View History

using System;
2022-01-25 20:57:22 +00:00
using Image.Output;
using Xunit;
namespace ImageCore.Tests
{
public class TestOriginalFilenameFileOutputPathFormatter
{
[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-01-25 20:57:22 +00:00
var outputPathFormatter = KeepFilenameFormatter.Create(directory);
Assert.Equal(expectedPath, outputPathFormatter.GetOutputPath(file));
}
[Fact]
public void TestGetOutputPathNull()
{
2022-01-25 20:57:22 +00:00
var outputPathFormatter = KeepFilenameFormatter.Create("directory");
Assert.Throws<ArgumentException>(() => outputPathFormatter.GetOutputPath(""));
}
}
}