Android ViewModel Unit Test Tutorial

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 30

  • @mehulbisht9708
    @mehulbisht9708 3 роки тому +5

    Sir even if creating videos won't be possible, please provide some more Blogs for tests that use Roboelectric for testing like you showed in the previous one. Also, if you have a mailing list that notifies about these blogs, kindly tell me I would love to subscribe to it for regular updates from you!

  • @jayantkumar1954
    @jayantkumar1954 3 роки тому +2

    Again awesome sir 🙏🙏.. Let me try flow instead of Live Data..

  • @username-tg7if
    @username-tg7if 3 роки тому +1

    please make same video with dagger hilt

  • @nestorperez1482
    @nestorperez1482 3 роки тому +1

    If you have a view model with a lot of dependencies you have to instantiate every dependecy, right? Wouldn't it be better to mock all viewmodel dependencies and UNIT test ONLY the view model? I can see that here you're testing more the repository than the view model.

    • @MrManish026
      @MrManish026 3 роки тому

      Agreed its an integration test according to me, its slow executes end to end. For unit test a spy/mock should have been used for db. Testing that method is called with right values is enough for unit testing, but for integration test we need to test that data is getting persisted when a method is called on view model

  • @ganeshkumarraja2282
    @ganeshkumarraja2282 3 роки тому +1

    Hey Belal.
    Thank you for your video.
    I like your way of presentation and you give a lot of useful information.
    Mostly we are supposed to write unit test lot to our codebase rather than UI and instrumentation testing because testing should be fast. Unit test is fast and other tests are ( instrumentation) a little slow compare to the Unit test.
    Here in the ViewModelTestClass, ViewModel only should be tested in the Unit test but here DAO class also is tested so it looks like it violates the unit test rules.
    ViewModel should be tested with unit test and dependency of the ViewModel should be mocked with ( Mockito or another mock library). or else we can use Roboelectric.
    It looks like these all videos come under the (Android test-driven development) but it is not TDD it is instrumentation testing.
    Please correct me If I am wrong.

  • @xdseries9905
    @xdseries9905 3 роки тому +1

    Sir Hindi Urdu video plz 🙏

  • @anujrai5894
    @anujrai5894 3 роки тому +1

    Bro can you make video series on JetPack compose

  • @gilsonjuniorpro
    @gilsonjuniorpro 2 роки тому

    The refresh is not working on the page to get the source code

  • @junecnol79
    @junecnol79 3 роки тому +1

    thanks. i am waiting for more tutorials on android testing

  • @sjlegends
    @sjlegends 2 роки тому

    do with Dagger

  • @Rajmanov
    @Rajmanov 3 роки тому +1

    Thank you!!

  • @emmanuelpregnolato5026
    @emmanuelpregnolato5026 3 роки тому

    Really good, tx.
    Quick question.
    If my live data can post not only for a value, but also a spinner for "while loading from network", like we have in many mvvm example...
    livedata.post(Resource.Loading)
    ...
    livedate.post(Resource.Success(data))
    Will the latch be 2?
    And on the onChange method, I will need to skip this loading phase?

  • @achalbadgujar9519
    @achalbadgujar9519 3 роки тому

    Hi belal ,ur tutorials are really helpful,but i just wanna give a suggestion kindly make the getting source code process easy like other chnnels ,even if i am subscribed to ur channel it shows subscribe channel and doesnt allow me to get access link

  • @TusharGogna
    @TusharGogna 3 роки тому

    registered and subscribed but unable to open GIT link

  • @pejmanazad5852
    @pejmanazad5852 3 роки тому

    in real companies which case is used? this method or a fake repository for run tests on JVM?

  • @tadiyal04
    @tadiyal04 3 роки тому

    Sir work on Instrumental testing topics.

  • @syedhassan1586
    @syedhassan1586 3 роки тому

    Sir, kindly explain OOP with professional examples for interview success and make a series for 1+ year of experienced Android developer interview questions. Thank you

  • @nothingextrachannel
    @nothingextrachannel 2 роки тому

    Thank you for your video.

  • @nitro2845
    @nitro2845 3 роки тому

    thanks you sir

  • @gamego6086
    @gamego6086 2 роки тому

    thanks

  • @petrovichvictor2536
    @petrovichvictor2536 3 роки тому

    YOU BEST!

  • @techmarinar
    @techmarinar 3 роки тому

    Thanks for the great effort ❤️

  • @agp1444
    @agp1444 3 роки тому

    androidTest folder is using for UI tests. not for unit tests

    • @SimplifiedCoding
      @SimplifiedCoding  3 роки тому

      both Instrumented Unit Test and UI Test are created inside this folder. I covered Instrumented Unit Test in this lesson.

    • @shravankumar-mm5bn
      @shravankumar-mm5bn 3 роки тому

      Please create RxJava tutorials