ResoCoder / flutter-tdd-clean-architecture-course

https://resocoder.com/flutter-clean-architecture-tdd/
2.01k stars 625 forks source link

test network_info_test (at least) does not work properly (Mock problem?) #26

Closed ValeriusGC closed 4 years ago

ValeriusGC commented 4 years ago

It passed well with original final tHasConnectionFuture = Future.value(true); as well as with final tHasConnectionFuture = Future.value(**false**); How so?

lukechi1219 commented 4 years ago

since your mockDataConnectionChecker.hasConnection answers Future.value(false) -> result

it's correct the test passes, because result (false) is same as your final tHasConnectionFuture = Future.value(false) .

expect(result, tHasConnectionFutureFalse);