dartz_test

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

dartz test

Provides matchers to help unit-testing your apps when using functional programming types defined in the dartz package.




Getting started #
Installation : #
dart pub add --dev dartz_test
Usage #
Eithers #
test('either is right', () {
Either either = Right('foo');

expect(either, isRight);
expect(either, isRightOf('foo'));
expect(either, isRightThat(equals('foo')));

var value = either.getRightOrFailTest();
expect(value, equals('foo'));
});
copied to clipboard
The same matchers exist for Left
Options #
test('option is none', () {
Option option = None();
expect(option, isNone);
});

test('option is Some', () {
Option option = Some('foo');

expect(option, isSome);
expect(option, isSomeOf('foo'));
expect(option, isSomeThat(equals('foo')));

var value = option.getOrFailTest();
expect(value, equals('foo'));
});
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.