Тёмный

Test Image Picking - Testing on Android - Part 14 

Philipp Lackner
Подписаться 182 тыс.
Просмотров 10 тыс.
50% 1

In this video we will test the functionality that we can pick an image from our PixabayAPI.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/...
Get the Source Code for this video here:
github.com/phi...
GET MY AUGMENTED REALITY UDEMY COURSE HERE:
www.udemy.com/...
Regular Android tutorials on my Instagram: / philipplackner_official
Checkout my GitHub: github.com/phi...

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@vamsee7875
@vamsee7875 4 года назад
One of the coolest tutorials thanks from india sir🙏
@PhilippLackner
@PhilippLackner 4 года назад
Thank you!
@steyren
@steyren 3 года назад
If anyone runs into issue with building creating viewModel using ViewModelFactory, I had to replace it with "val viewModel by viewModels()" initialization instead. You also need to annotate fragments and MainActivity with "@AndroidEntryPoint" if initializing viewModel this way
@VeronikaDoma-f5y
@VeronikaDoma-f5y Год назад
🙌🙌🙌
@roshaanfarrukh574
@roshaanfarrukh574 3 года назад
Hi Philip, Thanks for this awesome series, just one question. 25:19 You used "assert" after "verify" so if that test fails how would we know the exact reason whether verify failed or assert? Shouldn't we break it into two independent tests to avoid ambiguity?
@akashdeepwadhwa5828
@akashdeepwadhwa5828 3 года назад
assert is different from verify in the sense that asssert requires result ..whereas verify ..checks if particular function was called on certain events ..
@hossainehsani5696
@hossainehsani5696 Год назад
Phillip, looks like in newer versions of hilt it is not possible to access viewmodel or imageAdapter inside launchFragmentInHiltContainer block. Could you please check on that?
@Ilamarea
@Ilamarea 2 года назад
I've run into a problem. Navigation crashes because ImagePickFragment doesn't have an empty constructor - it uses @Inject constructor with adapter. But then FragmentFactory also has an @Inject constructor with the adapter... I'm confused by this. The AppModule doesn't even provide the adapter, so why is there even an @Inject? Is Hilt able to construct these without specifying it, so long as it has the things necessary?
@nikhilkatekhaye7773
@nikhilkatekhaye7773 4 года назад
Thank you so much for this video :)
@PhilippLackner
@PhilippLackner 4 года назад
You are welcome!
@chuka_obi5167
@chuka_obi5167 3 года назад
Hi Phillip, nice tutorial, this is an adapter question. Do you know why when using RoomDatabase and LiveData, AsyncListDiffer emits a different list if a particular element is removed or added to the list. So, for example if you have a list of 1,2,3 and you add 4 to the list. LiveData and Room know there is 1,2,3,4 in your list but AsyncListDiffer.currentList will return 1,2,3. But if you change the list, or delete item 2 from Room, Room and LiveData will return 1,3,4 but AsyncListDiffer.currentList will return 1,2,3,4 even if I call submitList() function anytime I change my list.
@mohaazizi8594
@mohaazizi8594 2 года назад
"Run Android instrumented tests using Gradle" option was ignored because this module type is not supported yet. when i run test , get this error . can you help me ?!
@ivankvych8182
@ivankvych8182 3 года назад
Very useful information))
@daniboy943
@daniboy943 2 года назад
24:42 what if the view model of ImagePickFragment need to be val and assigned by ActivityViewModels?
@tahabenly
@tahabenly 3 года назад
is there a way to use a viewmodel with the test repository when initializing the viewmodel with viewModels and activityViewModels property delegates ??
@homanhuang2054
@homanhuang2054 3 года назад
Non-Mockito version: imageUrl + testViewModel; launchFragmentInHiltContainer(fragmentFactory = fragmentFactory) { setGraph + setViewNavController + navigate; imageAdapter.images...; viewModel = testViewMode }; navController.popBackStack(); assertThat()___Use this example to get answer for blank test of video 13: imageUrl + testViewModel; testVM.setCurImageUrl(imageUrl); launchFragmentInHiltContainer {setGraph + setViewNavController + navigate; viewModel = testViewModel }; pressBack(); runOnUiThread {assertThat}
@nayeramohamed436
@nayeramohamed436 3 года назад
You created the fragment factory but you didn't use it. Where did you set it to a fragment manager and i also didn't find this in the source code
@homanhuang2054
@homanhuang2054 3 года назад
I have tried to remove the factory from the test but failed.
@ugur9826
@ugur9826 2 года назад
He used the fagment factory for injecting imageAdapter, image adapter can not inject directly into the fragment without fragmentfactory
@mustafaammar551
@mustafaammar551 3 года назад
very cool
@Alchemist10241
@Alchemist10241 3 года назад
It was a long but very useful video (20%s in 80/20 principle) 👍 I learned a lot of things. just please consider using ListAdapter instead of normal recyclerview adapter in your videos. thanks.
@rawlincrasto7851
@rawlincrasto7851 3 года назад
Can you link the documentation for Fragment and Navigation testing you used for these videos?
@shidqi100
@shidqi100 4 года назад
Great videos man, will you make a dagger hilt series man?
@sidharthv924
@sidharthv924 4 года назад
he has
@shidqi100
@shidqi100 4 года назад
@@sidharthv924 a series?
@PhilippLackner
@PhilippLackner 4 года назад
Running tracker app solves all your doubts regarding hilt
@sachin2dehury
@sachin2dehury 4 года назад
Hey .. How can i upload a pdf file to firebase store with the same name it has via an intent?
@SerhiiOr
@SerhiiOr 4 года назад
if i have several adapters what add to constructor in FragmentFactory class?
@PhilippLackner
@PhilippLackner 4 года назад
I don't get the question, just add all the adapters 🤔
@SerhiiOr
@SerhiiOr 4 года назад
@@PhilippLackner yes, already got it, thank you!
@javadjafari6373
@javadjafari6373 3 года назад
you are fucking awesome
@mrinaldas8660
@mrinaldas8660 3 года назад
👍👊👌
@johna8085
@johna8085 4 года назад
Hi, Will you do a workout fitness app tutorial on Kotlin?
@PhilippLackner
@PhilippLackner 4 года назад
I did a running tracker app
Далее
Stop Using FirstOrDefault in .NET! | Code Cop #021
12:54
6 Design Patterns Every Android Developer Must Know
14:16
Let, Also, Apply, Run, With - Kotlin Scope Functions
11:44