Delete test.
MODIFY
WalletWasabi.Tests/StoreTests.cs
WalletWasabi.Tests/StoreTests.cs
@@ -2,6 +2,7 @@ using NBitcoin;
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Stores;
@@ -20,5 +21,33 @@ namespace WalletWasabi.Tests
var network = Network.Main;
await indexStore.InitializeAsync(dir, network);
}
+
+ [Fact]
+ public async Task IoManagerTestsAsync()
+ {
+ var file1 = Path.Combine(Global.DataDir, nameof(IoManagerTestsAsync), $"file1.dat");
+ var file2 = Path.Combine(Global.DataDir, nameof(IoManagerTestsAsync), $"file2.dat");
+
+ Random random = new Random();
+ List<string> lines = new List<string>();
+ for (int i = 0; i < 1000; i++)
+ {
+ const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+ string line = new string(Enumerable.Repeat(chars, 100)
+ .Select(s => s[random.Next(s.Length)]).ToArray());
+
+ lines.Add(line);
+ }
+
+ // Single thread file operations
+
+ IoManager ioman1 = new IoManager(file1);
+
+ ioman1.DeleteMe();
+ Assert.False(ioman1.Exists());
+
+ await ioman1.WriteAllLinesAsync(lines);
+ }
}
}

Delete test.