// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Tests { using System.IO; using ImageSharp.Formats; /// /// The test base class. Inherit from this class for any image manipulation tests. /// public abstract class TestBase { /// /// Initializes static members of the class. /// static TestBase() { // Register the individual image formats. Bootstrapper.Default.AddImageFormat(new PngFormat()); Bootstrapper.Default.AddImageFormat(new JpegFormat()); Bootstrapper.Default.AddImageFormat(new BmpFormat()); Bootstrapper.Default.AddImageFormat(new GifFormat()); } /// /// Creates the image output directory. /// /// The path. /// The path parts. /// /// The . /// protected string CreateOutputDirectory(string path, params string[] pathParts) { path = Path.Combine("TestOutput", path); if (pathParts != null && pathParts.Length > 0) { path = Path.Combine(path, Path.Combine(pathParts)); } if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } return path; } } }