āđ„āļĄāđˆāļŠāļēāļĄāļēāļĢāļ–āđ€āļĨāđˆāļ™āļ§āļīāļ”āļĩāđ‚āļ­āļ™āļĩāđ‰
āļ‚āļ­āļ­āļ āļąāļĒāđƒāļ™āļ„āļ§āļēāļĄāđ„āļĄāđˆāļŠāļ°āļ”āļ§āļ

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: flatteredwithf...
    DevTo: dev.to/aseemwa...
    Source Code: github.com/Ase...
    In case, this helped, pass me a coffee!! 😊😊
    www.buymeacoff...
    #mockito #flutter #testing

āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™ • 3

  • @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?

  • @user-ps8zk7gm4n
    @user-ps8zk7gm4n āļ›āļĩāļ—āļĩāđˆāđāļĨāđ‰āļ§

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

  • @balajiramadoss6014
    @balajiramadoss6014 9 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

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