equatable_expect

Last updated:

0 purchases

equatable_expect Image
equatable_expect Images
Add to Cart

Description:

equatable expect

This is a simple package which helps you debug while writing tests. It pinpoints what is wrong with your data when comparing Equatable objects
Getting started #
Add the equatable package.
Usage #
const TwiceNestedEquatable tTwiceNestedEquatable = TwiceNestedEquatable(
'id', tFlatEquatable, OnceNestedEquatable('id', FlatEquatable('id', 'title')));

const TwiceNestedEquatable tTwiceNestedEquatableWrong = TwiceNestedEquatable(
'id', tFlatEquatable, OnceNestedEquatable('id', FlatEquatable('id', 'titleWrong')));

test(description, () {
// assert
equatableExpect(
tTwiceNestedEquatableWrong, tTwiceNestedEquatable);
});
copied to clipboard
Which outputs:
Expected: 'title'
Actual: 'titleWrong'
Which: is different. Both strings start the same, but the actual value also has the following trailing characters: Wrong

Path: TwiceNestedEquatable -> OnceNestedEquatable -> FlatEquatable -> String (Actual) / String (Matcher)
copied to clipboard

License:

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

Files In This Product:

Customer Reviews

There are no reviews.