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