Using Mockito in Flutter | Testing mocking viewmodel in flutter | Unit testing

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 มี.ค. 2022
  • A mock framework inspired by Mockito with APIs for Fakes, Mocks, behavior verification, and stubbing. We use the mockito package for writing unit tests and for generating the implementation it relies on build_runner.
    * Using Mockito in Flutter | Testing viewmodel repository using mockito in flutter*
    0:48 App architecture
    2:01 Installing Mockito
    2:26 Test architecture
    2:23 Overview of Producer and Consumer
    2:53 Mocking repository
    4:10 Generate Mock classes
    5:23 Testing repository
    7:53 Mocking viewmodel
    9:14 Testing viewmodel
    10:56 Code coverage VSCode
    12:04 Code coverage Android Studio
    Medium: / using-mockito-in-flutter
    Website: flatteredwithflutter.com/usin...
    DevTo: dev.to/aseemwangoo/using-mock...
    Source Code: github.com/AseemWangoo/dynamism
    In case, this helped, pass me a coffee!! 😊😊
    www.buymeacoffee.com/aseemwangoo
    #mockito #flutter #testing

ความคิดเห็น • 3

  • @user-ps8zk7gm4n
    @user-ps8zk7gm4n ปีที่แล้ว

    Thansk!! I was confused about the setting, but I found out thanks to you.

  • @Sean2046
    @Sean2046 ปีที่แล้ว +3

    If you are stubbing canned responses that you expect and injecting mock classes where you call that method with the stub, and doing expect() and getting a return of what you just stubbed it with, is that really a useful test?

  • @balajiramadoss6014
    @balajiramadoss6014 8 หลายเดือนก่อน

    why do we need HomeRepo since classes are implicitly interface in dart?