Dedup SendTests
MODIFY
WalletWasabi.Tests/RegressionTests/SendTests.cs
WalletWasabi.Tests/RegressionTests/SendTests.cs
@@ -60,11 +60,7 @@ public class SendTests
// 5. Create wallet service.
var workDir = Helpers.Common.GetWorkDir();
- var cache = new MemoryCache(new MemoryCacheOptions
- {
- SizeLimit = 1_000,
- ExpirationScanFrequency = TimeSpan.FromSeconds(30)
- });
+ using MemoryCache cache = CreateMemoryCache();
var blockProvider = new SmartBlockProvider(
bitcoinStore.BlockRepository,
@@ -546,11 +542,7 @@ public class SendTests
// 5. Create wallet service.
var workDir = Helpers.Common.GetWorkDir();
- var cache = new MemoryCache(new MemoryCacheOptions
- {
- SizeLimit = 1_000,
- ExpirationScanFrequency = TimeSpan.FromSeconds(30)
- });
+ using MemoryCache cache = CreateMemoryCache();
var blockProvider = new SmartBlockProvider(
bitcoinStore.BlockRepository,
@@ -728,11 +720,7 @@ public class SendTests
// 5. Create wallet service.
var workDir = Helpers.Common.GetWorkDir();
- var cache = new MemoryCache(new MemoryCacheOptions
- {
- SizeLimit = 1_000,
- ExpirationScanFrequency = TimeSpan.FromSeconds(30)
- });
+ using MemoryCache cache = CreateMemoryCache();
var blockProvider = new SmartBlockProvider(
bitcoinStore.BlockRepository,
@@ -807,4 +795,13 @@ public class SendTests
node?.Disconnect();
}
}
+
+ private static MemoryCache CreateMemoryCache()
+ {
+ return new MemoryCache(new MemoryCacheOptions
+ {
+ SizeLimit = 1_000,
+ ExpirationScanFrequency = TimeSpan.FromSeconds(30)
+ });
+ }
}

Dedup SendTests