test(app): sample card, server quota, current archive and sample report checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+139
-43
No files matched your search
@@ -76,6 +76,22 @@ public sealed class ServerImportSinkTests(TestContext context)
|
||||
Assert.Empty(server.Committed);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TheQuotaIsTheRoomOfAServerImport()
|
||||
{
|
||||
var card = Card(context.CreateTempDirectory("card"), 8, Start);
|
||||
var staging = context.CreateTempDirectory("staging");
|
||||
var plan = await new UnindexedDestination(ImportDestinationKind.Server, staging) { ServerSpace = 1_000 }
|
||||
.PlanAsync(card, new ImportChoices().ToOptions(), null, null, context.Cancellation);
|
||||
Assert.Equal(1_000L, plan.AvailableBytes);
|
||||
Assert.False(ImportPlans.Totals(plan, verify: true).HasEnoughSpace, "eight photos do not fit in 1 KB of quota");
|
||||
|
||||
var unlimited = await new UnindexedDestination(ImportDestinationKind.Server, staging).PlanAsync(card, new ImportChoices().ToOptions(), null, null,
|
||||
context.Cancellation);
|
||||
Assert.Null(unlimited.AvailableBytes);
|
||||
Assert.True(ImportPlans.Totals(unlimited, verify: true).HasEnoughSpace);
|
||||
}
|
||||
|
||||
/// <summary>Start, chunk and complete of BRIEF §14.4, plus the title update; the hash is checked at completion.</summary>
|
||||
private sealed class FakeUploadServer(int chunkSize) : HttpMessageHandler
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user