parameterized_test 0.0.4 copy "parameterized_test: ^0.0.4" to clipboard
parameterized_test: ^0.0.4 copied to clipboard

outdated

Simple package that helps with executing parameterized tests. Inspired by JUnit ParameterizedTest CsvValues.

example/parameterized_test_example.dart

import 'package:parameterized_test/parameterized_test.dart';
import 'package:parameterized_test/src/parameterized_source.dart';
import 'package:test/test.dart';

void main() {
  parameterizedTest(
    'Amount of letters',
    ParameterizedSource.csv([
      'kiwi, 4',
      'apple, 5',
      'banana, 6',
    ]),
    (List<dynamic> values) {
      final String input = values[0];
      final expected = values[1];

      final actual = input.length;

      expect(actual, expected);
    },
  );

  parameterizedTest(
    'Amount of letters',
    ParameterizedSource.values([
      ['kiwi', 4],
      ['apple', 5],
      ['banana', 6],
    ]),
    (List<dynamic> values) {
      final String input = values[0];
      final expected = values[1];

      final actual = input.length;

      expect(actual, expected);
    },
  );

  parameterizedTest(
    'Words with 4 letters',
    ParameterizedSource.value([
      'kiwi',
      'bike',
      'four',
    ]),
    (List<dynamic> values) {
      final String input = values[0];

      final actual = input.length;

      expect(actual, 4);
    },
  );
}
11
likes
0
pub points
76%
popularity

Publisher

verified publisherdutchcodingcompany.com

Simple package that helps with executing parameterized tests. Inspired by JUnit ParameterizedTest CsvValues.

Homepage

License

unknown (license)

Dependencies

meta, test

More

Packages that depend on parameterized_test