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

scalable Flutter testing framework enforcing tests via well defined test cases

testify #

scalable Flutter testing framework #

declaratively create test cases and easily run them #

specify virtually any test case for a testable unit by ...

  • specifying unit type parameter T inside TestCase
  • add a test description
  • provide an assembler "builder" function and return the unit
  • act on the unit and return it
  • assert unit with usual test utility

ADD TO DEV_DEPENDENCIES #

dev_dependencies:
  testify:

DECLARE LIST OF TestCases #

List<TestCase<Counter>> testCaseList = [
    TestCase<Counter>(
      description: 'properly increments the counter',
      assembler: () => Counter(),
      actors: [
        (counter) {
          counter.increment();
          return counter;
        },
      ],
      matchers: [
        (counter) {
          expect(counter.count, equals(1));
        }
      ],
    ),
    TestCase<Counter>(
      description: 'properly decrements the counter',
      assembler: () => Counter(),
      actors: [
        (counter) {
          counter.decrement();
          return counter;
        },
      ],
      matchers: [
        (counter) {
          expect(counter.count, equals(-1));
        }
      ],
    ),
  ];

RUN TestCase LIST WITH TestCaseExecutor #

var testCaseExecutor = TestCaseExecutor(testCaseList);
testCaseExecutor.run();
3
likes
130
pub points
0%
popularity

Publisher

verified publisherquantumgray.tech

scalable Flutter testing framework enforcing tests via well defined test cases

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (LICENSE)

Dependencies

flutter_test

More

Packages that depend on testify