+ {
+ (0, "0 B"),
+ ((uint)0, "0 B"),
+ ((long)0, "0 B"),
+ ((ulong)0, "0 B"),
+
+ (1, "1 B"),
+ (1024, "1 KB"),
+ ((ulong)(1.1 * 1024), "1.1 KB"),
+ (1024 * 1024, "1 MB"),
+ (1024 * 1024 * 1024, "1 GB"),
+ ((ulong)1024 * 1024 * 1024 * 1024, "1 TB"),
+ ((ulong)1024 * 1024 * 1024 * 1024 * 1024, "1 PB"),
+ ((ulong)1024 * 1024 * 1024 * 1024 * 1024 * 1024, "1 EB"),
+ (ulong.MaxValue, "16 EB"),
+ };
+
+ var converter = new FriendlyByteConverter();
+ foreach (var (input, expected) in cases)
+ {
+ var actual = converter.Convert(input, typeof(string), null, null);
+ Assert.That(actual, Is.EqualTo(expected), $"case ({input.GetType()}){input}");
+ }
+ }
+}
diff --git a/Tests.App/Services/MutagenControllerTest.cs b/Tests.App/Services/MutagenControllerTest.cs
index 40d6a48..be054a7 100644
--- a/Tests.App/Services/MutagenControllerTest.cs
+++ b/Tests.App/Services/MutagenControllerTest.cs
@@ -90,12 +90,12 @@ public async Task CreateRestartsDaemon(CancellationToken ct)
await using (var controller = new MutagenController(_mutagenBinaryPath, dataDirectory))
{
await controller.Initialize(ct);
- await controller.CreateSyncSession(new SyncSession(), ct);
+ await controller.CreateSyncSession(new CreateSyncSessionRequest(), ct);
}
var logPath = Path.Combine(dataDirectory, "daemon.log");
Assert.That(File.Exists(logPath));
- var logLines = File.ReadAllLines(logPath);
+ var logLines = await File.ReadAllLinesAsync(logPath, ct);
// Here we're going to use the log to verify the daemon was started 2 times.
// slightly brittle, but unlikely this log line will change.
@@ -114,7 +114,7 @@ public async Task Orphaned(CancellationToken ct)
{
controller1 = new MutagenController(_mutagenBinaryPath, dataDirectory);
await controller1.Initialize(ct);
- await controller1.CreateSyncSession(new SyncSession(), ct);
+ await controller1.CreateSyncSession(new CreateSyncSessionRequest(), ct);
controller2 = new MutagenController(_mutagenBinaryPath, dataDirectory);
await controller2.Initialize(ct);
@@ -127,7 +127,7 @@ public async Task Orphaned(CancellationToken ct)
var logPath = Path.Combine(dataDirectory, "daemon.log");
Assert.That(File.Exists(logPath));
- var logLines = File.ReadAllLines(logPath);
+ var logLines = await File.ReadAllLinesAsync(logPath, ct);
// Here we're going to use the log to verify the daemon was started 3 times.
// slightly brittle, but unlikely this log line will change.
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy