Skip to content

Commit

Permalink
test(InteractionOutput): add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 27, 2024
1 parent 619002c commit 1fbab78
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/core/interaction_output_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,27 @@ void main() {
final value2 = await interactionOutput.value();
expect(value1, value2);
});

test(
"throw a NotReadableException when calling the arrayBuffer() method "
"twice", () async {
final contentSerdes = ContentSerdes();
final content = Content(
"text/plain",
const Stream.empty(),
);

final interactionOutput = InteractionOutput(
content,
contentSerdes,
Form(Uri.parse("http://example.org")),
const DataSchema(),
);

await interactionOutput.arrayBuffer();

final result = interactionOutput.arrayBuffer();
await expectLater(result, throwsA(isA<NotReadableException>()));
});
});
}

0 comments on commit 1fbab78

Please sign in to comment.