Skip to content

Commit

Permalink
📝 fix examples in ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Sulimau committed Feb 11, 2024
1 parent 7131281 commit cf0df1b
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!--
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

# 🧪 Parameterized test
Expand Down Expand Up @@ -36,8 +36,8 @@ Supercharge your Dart testing with **parameterized_test**! Built on top of the [
## Installation

```yaml
dev_dependencies:
parameterized_test: [latest-version]
dev_dependencies:
parameterized_test: [latest-version]
```

## Usage
Expand Down Expand Up @@ -153,13 +153,13 @@ group('Amount of letter', () {
['kiwi', 4],
['apple', 5],
['banana', 6],
],
];
for(final testValue in testValues){
for (final testValue in testValues) {
test(testValue.toString(), () {
final String word = testValue[0] as String;
final int length = testValue[1] as int;
expect(word.length, length);
});
}
Expand All @@ -172,7 +172,7 @@ Currently the package supports `TestParameters` classes up to 10 arguments. If n

For example:
```dart
class MyParameters implements TestParameters{
class MyParameters<A1, A2> implements TestParameters {
const MyParameters(this.body);
@override
Expand All @@ -182,17 +182,15 @@ class MyParameters implements TestParameters{
final int count = 2;
@override
void mapBody<R>(Iterable<R> values) {
final A1 a1 = values.elementAt(0) as A1;
final A2 a2 = values.elementAt(1) as A2;
body(a1, a2);
}
dynamic mapBody<R>(Iterable<R> values) {
final A1 a1 = values.elementAt(0) as A1;
final A2 a2 = values.elementAt(1) as A2;
return body(a1, a2);
}
}
```

## Additional information

Its just a simple wrapper to easily execute tests multiple times with different values. Feel free to
leave some feedback or open an pull request :)
leave some feedback or open an pull request :)

0 comments on commit cf0df1b

Please sign in to comment.