Write 3X Better Unit Tests using Abstraction | Flutter Unit Testing

preview_player
Показать описание
In this tutorial we go over how abstraction helps you write better, maintainable and 100% reliable unit tests in Flutter. This is the second video in the abstraction series.

Рекомендации по теме
Комментарии
Автор

Amazing! The more abstraction you have, the fewer headaches you suffer!

ResoCoder
Автор

A full tutorial would be great! You make the most practical and useful flutter videos I've seen so far 👏

Benony
Автор

Great work! Please do a full tutorial on Flutter TDD :)

schalkvorster
Автор

This video is GOLD! This together with "Flutter Provider V3 Architecture | ProxyProvider for Dependency Injection" is exactly what I was looking for!
Would be awesome if you could create a video with TDD and Provider V3 and also talk about the folder/file structure you use to organize your code.
Thanks a lot for sharing!

dc
Автор

Thanks for sharing your knowledge! Looking forward to more videos, especially around TDD and unit testing.

jeffgiesbrecht
Автор

Absolutely insane. I'd really enjoy a full TDD tutorial. Kee going!

pitazzo-jh
Автор

for those who had flutter related testing issue to make the test at 2:36 pass according to 11 May 2020 you need to update your flutter version to the latest stable channel and then re-run the test then everything will run fine

mohabmagdy
Автор

More in depth TDD + Unit Testing please. Thanks a lot for your great work!!!

oliverbytes
Автор

Hello, great video. I have a question, what if I need to verify a method call inside the same PostService class ?

prrs
Автор

If you maintain your abstractions properly and have fake prop versions of it, ready, so that you can test your programs, faster, i think mocking everywhere might be unnecessary and you can just use the props and minimal mocks to still maintain the unit tests, this is particularly useful if you're mocks start becoming more complex, depending on the business logic, and will help you make your tests more readable and also save you time and reduce complexity, Awesome video btw !

teitoklien
Автор

Another helpful video for rapidly learning Dart/Flutter/Testing. Tx!

greggdourgarian
Автор

Awesome tutorial. I want to learn more about this topic. Do you have any tips for Solo Developers? It's difficult to start with TDD when you're freelancing or working on a startup.

elherediaenc
Автор

Please make a full test tutorial,
And i want to ask you about your opinion in "Hive" package as a replacement for shared preference they claimed to be much faster and efficient

berosolo
Автор

It would be very helpful to have also some example on how you would implement your architecture for Create/Update/Delete logic, some data modification, not just getting data, as well as unit tests for those.. Thanks!

dc
Автор

If using Firestore as the storage solution, how would you do a unit test for the following scenario.
Have a TODO App and want to change a Task status to done. So you basically would have a "todo_service", or "storage_service" with a method like this


Future toggleTask(Task task) {
var ref =
ref.updateData({'done': !task.done};
}
At this point, the task is already updated, but without actually doing task.done = !task.done directly on the task, the update depends on Firestore. You could spin up the firestore-emulator I guess, but I wonder how would you solve that case.
Thanks!

dc
Автор

Excellent demo, any reason you didn’t make mockito a dev dependency?

LeviCook
Автор

I'd appreciate any input you have on TDD or testing in general. learning OOP, testing seems like a level of complexity I can't even wrap my head around yet.

Writing meaningful tests seems like an art that will take a ton of time and practice to learn, and having a suspect/bug-prone app in the meantime. Most of the examples I've found for flutter tests seem trivial, like "does this widget return one widget". Not sure why that would be useful development time spent to write.

tylerthornton
Автор

Wouldn't it be possible to create a mock class without defining the interfaces? For example something like this: 
`class MockStorageService extends Mock implements LocalStorageService {}`

Sergey-fcgv
Автор

Great tutorial!, can you make a video explaining how to setup this abstractions and unit testing with BloC pattern ???

StanleySalvatierra
join shbcf.ru