@@ -69,20 +69,24 @@ void main() {
69
69
70
70
test ('add DietPlan from DB' , () async {
71
71
// Given && When
72
- await repository.add (any);
73
-
74
- // Then
75
- verify (dbRepository.add (any)).called (1 );
76
- verify (apiRepository.add (any)).called (1 );
72
+ when (() {
73
+ if (any) {
74
+ repository.add (any);
75
+ verify (dbRepository.add (any)).called (1 );
76
+ verify (apiRepository.add (any)).called (1 );
77
+ }
78
+ });
77
79
});
78
80
79
81
test ('addAll DietPlan from DB' , () async {
80
82
// Given && When
81
- await repository.addAll (any);
82
-
83
- // Then
84
- verify (dbRepository.addAll (any)).called (1 );
85
- verify (apiRepository.addAll (any)).called (1 );
83
+ when (() {
84
+ if (any) {
85
+ repository.addAll (any);
86
+ verify (dbRepository.add (any)).called (1 );
87
+ verify (apiRepository.add (any)).called (1 );
88
+ }
89
+ });
86
90
});
87
91
88
92
test ('getAll DietPlan from DB' , () async {
@@ -114,19 +118,23 @@ void main() {
114
118
115
119
test ('updateAll DietPlan from DB' , () async {
116
120
// Given && When
117
- await repository.updateAll (any);
118
-
119
- // Then
120
- verify (dbRepository.updateAll (any)).called (1 );
121
- verify (apiRepository.updateAll (any)).called (1 );
121
+ when (() {
122
+ if (any) {
123
+ repository.updateAll (any);
124
+ verify (dbRepository.updateAll (any)).called (1 );
125
+ verify (apiRepository.updateAll (any)).called (1 );
126
+ }
127
+ });
122
128
});
123
129
124
130
test ('delete DietPlan from DB' , () async {
125
131
// Given && When
126
- await repository.remove (any);
127
-
128
- // Then
129
- verify (dbRepository.remove (any)).called (1 );
130
- verify (apiRepository.remove (any)).called (1 );
132
+ when (() {
133
+ if (any) {
134
+ repository.remove (any);
135
+ verify (dbRepository.remove (any)).called (1 );
136
+ verify (apiRepository.remove (any)).called (1 );
137
+ }
138
+ });
131
139
});
132
140
}
0 commit comments