From b9402e71aa3c6ebc37b444a6925305d7bcae2caf Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Tue, 12 Jul 2022 16:50:08 +0200 Subject: [PATCH] refactor: make input creation for content_serdes test more flexible --- test/core/content_serdes_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/core/content_serdes_test.dart b/test/core/content_serdes_test.dart index 84901252..add0cd20 100644 --- a/test/core/content_serdes_test.dart +++ b/test/core/content_serdes_test.dart @@ -9,8 +9,8 @@ import 'package:dart_wot/src/core/content_serdes.dart'; import 'package:dart_wot/src/definitions/data_schema.dart'; import 'package:test/test.dart'; -Content _getTestContent() { - return Content('application/json', Stream>.value('42'.codeUnits)); +Content _getTestContent(String input) { + return Content('application/json', Stream>.value(input.codeUnits)); } void main() { @@ -23,7 +23,7 @@ void main() { test('Content Validation', () async { final contentSerdes = ContentSerdes(); - final testContent1 = _getTestContent(); + final testContent1 = _getTestContent('42'); final successfulSchema = DataSchema.fromJson({'type': 'number'}); @@ -32,7 +32,7 @@ void main() { 42, ); - final testContent2 = _getTestContent(); + final testContent2 = _getTestContent('42'); final failingSchema = DataSchema.fromJson({'type': 'string'});