mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-13 14:45:50 +00:00
Clean up tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
DiscordChatExporter.Cli.Tests/Utils/Pollyfills.cs
Normal file
9
DiscordChatExporter.Cli.Tests/Utils/Pollyfills.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
// ReSharper disable CheckNamespace
|
||||
// TODO: remove after moving to .NET 5
|
||||
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
internal static class IsExternalInit
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user