DwFakeStorage class final

File uploads for tests of a client and the screens on top of it: the framework's file calls answered by a DwFakeServer, and a storage in memory behind transport that holds a ticket to what a presigned URL holds real clients to — the signed length and type, no overwrite.

final server = DwFakeServer(protocol: appProtocol);
final storage = DwFakeStorage(server);
final client = server.newClient(storageTransport: storage.transport);

Not the real storage rules: no purposes, no limits beyond refuseStart, no permissions. What it reproduces is the sequence a client goes through and the ways each step can go wrong.

Constructors

DwFakeStorage(DwFakeServer server)

Properties

answerStatuses → List<int>
Statuses storage answers instead of storing, one per put.
final
chunkDelay ↔ Duration
A pause before each chunk of a body is read — for watching progress.
getter/setter pair
failPuts ↔ int
Puts that fail on the network before storing anything, one per put.
getter/setter pair
files → List<DwStoredFile>
The files confirmed so far.
no setter
hashCode → int
The hash code for this object.
no setterinherited
loseAnswers ↔ int
Puts that store the object and then fail on the network: the answer is lost, the upload arrived.
getter/setter pair
objects → Map<int, DwFakeObject>
Objects by ticket id.
final
puts ↔ int
Every put that reached storage, stored or not.
getter/setter pair
refuseStart ↔ DwCallRefusal? Function(DwStartUpload command)?
Refuses a start when it returns a refusal: a size, a type, a permission.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
server → DwFakeServer
final
ticketLifetime ↔ Duration
How long a ticket lasts.
getter/setter pair
transport → DwMemoryStorageTransport
Carries uploads to this storage.
latefinal

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited