Android Espresso does not have a NavController set Error
问题 I am trying to test a fragment in my navigation architecture and my test is as follows: test.kt @RunWith(AndroidJUnit4::class) @MediumTest internal class AddingAccountTest{ @get:Rule var activityRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java) @Before fun loadCorrespondingFragment(){ } @Test fun checkThatAllFieldsInFormAreEmpty(){ // Create a TestNavHostController val navController = TestNavHostController(ApplicationProvider.getApplicationContext())