Skip to content

Commit

Permalink
refactor: make input creation for content_serdes test more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jul 12, 2022
1 parent e0e512d commit b9402e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/core/content_serdes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<List<int>>.value('42'.codeUnits));
Content _getTestContent(String input) {
return Content('application/json', Stream<List<int>>.value(input.codeUnits));
}

void main() {
Expand All @@ -23,7 +23,7 @@ void main() {
test('Content Validation', () async {
final contentSerdes = ContentSerdes();

final testContent1 = _getTestContent();
final testContent1 = _getTestContent('42');
final successfulSchema =
DataSchema.fromJson(<String, dynamic>{'type': 'number'});

Expand All @@ -32,7 +32,7 @@ void main() {
42,
);

final testContent2 = _getTestContent();
final testContent2 = _getTestContent('42');
final failingSchema =
DataSchema.fromJson(<String, dynamic>{'type': 'string'});

Expand Down

0 comments on commit b9402e7

Please sign in to comment.