mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
// 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
|
|
{
|
|
/// <summary>
|
|
/// The test base class. Inherit from this class for any image manipulation tests.
|
|
/// </summary>
|
|
public abstract class TestBase
|
|
{
|
|
/// <summary>
|
|
/// Creates the image output directory.
|
|
/// </summary>
|
|
/// <param name="path">The path.</param>
|
|
/// <param name="pathParts">The path parts.</param>
|
|
/// <returns>
|
|
/// The <see cref="string"/>.
|
|
/// </returns>
|
|
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;
|
|
}
|
|
}
|
|
}
|