Skip to content

Commit

Permalink
Refactor SpinifyTransportFake to handle different RPC methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed May 23, 2024
1 parent ce3c058 commit f02b6d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/transport_fake.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,15 @@ class SpinifyTransportFake implements ISpinifyTransport {
since: (epoch: '...', offset: Int64.ZERO),
),
);
case SpinifyRPCRequest(:int id, :List<int> data):
case SpinifyRPCRequest(:int id, :String method, :List<int> data):
_response(
(now) => SpinifyRPCResult(
id: id,
timestamp: now,
data: data,
data: switch (method) {
'echo' => data,
_ => throw ArgumentError('Unknown method: $method'),
},
),
);
case SpinifyRefreshRequest(:int id):
Expand Down

0 comments on commit f02b6d3

Please sign in to comment.