dartz_test 0.0.3 copy "dartz_test: ^0.0.3" to clipboard
dartz_test: ^0.0.3 copied to clipboard

outdated

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

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


codecov License

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'));
  });

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'));
  });

Additional information #

Don't expect anything from this package for now.

2
likes
0
points
347
downloads

Publisher

verified publishersupermuel.fr

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dartz, test

More

Packages that depend on dartz_test