not sure if I understand you correctly. You want to test props? Not needed, this is a object used by Equatable, it only lists all variables included in this class.
However, if you want to check if all variables are in params included, you can check this according to the following:
class Person extends Equatable { // example
const Person(this.name);
final String name;
@override
List<object?>get props => []
}
...
final Person bob = Person("Bob");
test('Validate ChangeTabEvent equality', () {
expect(bob, equals(Person("Bob"));
});
2
Answers
not sure if I understand you correctly. You want to test
props
? Not needed, this is a object used by Equatable, it only lists all variables included in this class.However, if you want to check if all variables are in
params
included, you can check this according to the following:fails, because you have not
name
inparams
You can add an expect to check the props if the values are as to what value/s you are expecting.
One solution to cover those lines would be: