mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 23:42:00 +01:00
fix test
This commit is contained in:
@@ -139,4 +139,21 @@ class NutritionalGoals {
|
||||
//ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||
int get hashCode => Object.hash(
|
||||
energy, protein, carbohydrates, carbohydratesSugar, fat, fatSaturated, fibres, sodium);
|
||||
|
||||
@override
|
||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
return other is NutritionalGoals &&
|
||||
other.energy == energy &&
|
||||
other.protein == protein &&
|
||||
other.carbohydrates == carbohydrates &&
|
||||
other.carbohydratesSugar == carbohydratesSugar &&
|
||||
other.fat == fat &&
|
||||
other.fatSaturated == fatSaturated &&
|
||||
other.fibres == fibres &&
|
||||
other.sodium == sodium;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,17 @@ void main() {
|
||||
|
||||
group('model tests', () {
|
||||
test('Test the nutritionalValues method for nutritional plans', () {
|
||||
final values = NutritionalValues.values(4118.75, 32.75, 347.5, 9.5, 59.0, 37.75, 52.5, 30.5);
|
||||
expect(plan.nutritionalGoals, values);
|
||||
expect(
|
||||
plan.nutritionalGoals,
|
||||
NutritionalGoals(
|
||||
energy: 4118.75,
|
||||
protein: 32.75,
|
||||
carbohydrates: 347.5,
|
||||
carbohydratesSugar: 9.5,
|
||||
fat: 59.0,
|
||||
fatSaturated: 37.75,
|
||||
fibres: 52.5,
|
||||
sodium: 30.5));
|
||||
});
|
||||
|
||||
test('Test the nutritionalValues method for meals', () {
|
||||
|
||||
Reference in New Issue
Block a user