// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.IO;
using System.Reflection;
using SixLabors.ImageSharp.Formats;
namespace SixLabors.ImageSharp.Tests
{
///
/// The test base class. Inherit from this class for any image manipulation tests.
///
public abstract class TestBase
{
///
/// Creates the image output directory.
///
/// The path.
/// The path parts.
///
/// The .
///
protected string CreateOutputDirectory(string path, params string[] pathParts)
{
path = Path.Combine(TestEnvironment.ActualOutputDirectoryFullPath, path);
if (pathParts != null && pathParts.Length > 0)
{
path = Path.Combine(path, Path.Combine(pathParts));
}
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
}