From aad4c715abd8050f360a3e42da03783123112b06 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 17 Jul 2017 02:20:17 +0200 Subject: [PATCH] made FormatsDirectory a lazy value -> folders are no longer walked in TestFile type initializer. Might be healthy for test discoverers. --- tests/ImageSharp.Tests/TestFile.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index c0f9deebb..7373b70c5 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -25,10 +25,10 @@ namespace ImageSharp.Tests private static readonly ConcurrentDictionary Cache = new ConcurrentDictionary(); /// - /// The formats directory. + /// The formats directory, as lazy value /// - private static readonly string FormatsDirectory = GetFormatsDirectory(); - + private static readonly Lazy formatsDirectory = new Lazy(GetFormatsDirectory); + /// /// The image. /// @@ -71,6 +71,11 @@ namespace ImageSharp.Tests /// public string FileNameWithoutExtension => Path.GetFileNameWithoutExtension(this.file); + /// + /// Gets the "Formats" test file directory. + /// + private static string FormatsDirectory => formatsDirectory.Value; + /// /// Gets the full qualified path to the file. ///