From 3e233139aa9a5d394ef4722b47bd3e3013a3a2e3 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 17 Jul 2017 02:23:45 +0200 Subject: [PATCH] made FormatsDirectory a lazy value -> folders are no longer walked in TestFile type initializer. Might be healthy for test discoverers. Conflicts: tests/ImageSharp.Tests/TestFile.cs --- 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 2b505a2e46..13944cc3c3 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); + private Image _image; private byte[] _bytes; @@ -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. ///