How can I test fragments with Robolectric?

后端 未结 7 1089
萌比男神i
萌比男神i 2020-12-02 10:16

I know there is a Robolectric.shadowOf(Fragment) method and a ShadowFragment class, thought they aren\'t listed on the docs, but I can\'t make it w

相关标签:
7条回答
  • 2020-12-02 11:12

    You guys are all doing this the hard way. Just use FragmentTestUtil.

    FragmentTestUtil.startFragment(yourfragment);
    
    0 讨论(0)
提交回复
热议问题