Browse Source

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
pull/275/head
Anton Firszov 9 years ago
parent
commit
3e233139aa
  1. 11
      tests/ImageSharp.Tests/TestFile.cs

11
tests/ImageSharp.Tests/TestFile.cs

@ -25,10 +25,10 @@ namespace ImageSharp.Tests
private static readonly ConcurrentDictionary<string, TestFile> Cache = new ConcurrentDictionary<string, TestFile>();
/// <summary>
/// The formats directory.
/// The formats directory, as lazy value
/// </summary>
private static readonly string FormatsDirectory = GetFormatsDirectory();
private static readonly Lazy<string> formatsDirectory = new Lazy<string>(GetFormatsDirectory);
private Image<Rgba32> _image;
private byte[] _bytes;
@ -71,6 +71,11 @@ namespace ImageSharp.Tests
/// </summary>
public string FileNameWithoutExtension => Path.GetFileNameWithoutExtension(this.file);
/// <summary>
/// Gets the "Formats" test file directory.
/// </summary>
private static string FormatsDirectory => formatsDirectory.Value;
/// <summary>
/// Gets the full qualified path to the file.
/// </summary>

Loading…
Cancel
Save