Skip to content

Commit

Permalink
test: add tests for InteractionOutput class
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 30, 2023
1 parent 1916a0e commit 3643756
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/core/interaction_output_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2023 Contributors to the Eclipse Foundation. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// SPDX-License-Identifier: BSD-3-Clause

import 'dart:convert';

import 'package:dart_wot/src/core/content.dart';
import 'package:dart_wot/src/core/content_serdes.dart';
import 'package:dart_wot/src/core/interaction_output.dart';
import 'package:test/test.dart';

void main() {
group('InteractionOutput should', () {
test('output the correct value', () async {
const inputValue = 'foo';
final input = utf8.encode(inputValue);

final contentSerdes = ContentSerdes();
final content = Content(
'text/plain',
Stream.fromIterable([
input,
]),
);

final interactionOutput = InteractionOutput(content, contentSerdes);

final value = await interactionOutput.value();
expect(value, inputValue);
});
});
}

0 comments on commit 3643756

Please sign in to comment.