Clean up tests

This commit is contained in:
Tyrrrz
2021-09-08 01:18:35 +03:00
parent 301bca0633
commit 67313f2b22
10 changed files with 229 additions and 515 deletions

View File

@@ -1,22 +0,0 @@
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
namespace DiscordChatExporter.Cli.Tests.Utils
{
internal static class GlobalCache
{
private static readonly ConcurrentDictionary<string, object?> Dictionary = new();
public static async Task<T> WrapAsync<T>(string key, Func<Task<T>> getAsync)
{
if (Dictionary.TryGetValue(key, out var value) && value is T existing)
return existing;
var result = await getAsync();
Dictionary[key] = result;
return result;
}
}
}

View File

@@ -0,0 +1,9 @@
// ReSharper disable CheckNamespace
// TODO: remove after moving to .NET 5
namespace System.Runtime.CompilerServices
{
internal static class IsExternalInit
{
}
}