app/src/androidTestMock/java/com/example/android/testing/notes/notedetail/NoteDetailScreenTest.java
/**
     * Setup your test fixture with a fake note id. The {@link NoteDetailActivity} is started with
     * a particular note id, which is then loaded from the service API.
     *
     * <p>
     * Note that this test runs hermetically and is fully isolated using a fake implementation of
     * the service API. This is a great way to make your tests more reliable and faster at the same
     * time, since they are isolated from any outside dependencies.
     */
Setup your test fixture with a fake note id. The  NoteDetailActivity is started with
a particular note id, which is then loaded from the service API.


Note that this test runs hermetically and is fully isolated using a fake implementation of
the service API. This is a great way to make your tests more reliable and faster at the same
time, since they are isolated from any outside dependencies.
Setup your test fixture with a fake note id . The NoteDetailActivity is started with a particular note id which is then loaded from the service API . Note that this test runs hermetically and is fully isolated using a fake implementation of the service API . This is a great way to make your tests more reliable and faster at the same time since they are isolated from any outside dependencies .
@Before
    public void intentWithStubbedNoteId() {
        FakeNotesServiceApiImpl.addNotes(NOTE);
        Intent startIntent = new Intent();
        startIntent.putExtra(NoteDetailActivity.EXTRA_NOTE_ID, NOTE.getId());
        mNoteDetailActivityTestRule.launchActivity(startIntent);
        registerIdlingResource();
    }
@ Before public void intentWithStubbedNoteId ( ) { FakeNotesServiceApiImpl . addNotes ( NOTE ) ; Intent startIntent = new Intent ( ) ; startIntent . putExtra ( NoteDetailActivity . EXTRA_NOTE_ID , NOTE . getId ( ) ) ; mNoteDetailActivityTestRule . launchActivity ( startIntent ) ; registerIdlingResource ( ) ; }
Setup your test fixture with a fake note id.
Setup your test fixture with a fake note id .
// Add a note stub to the fake service api layer. // Lazily start the Activity from the ActivityTestRule this time to inject the start Intent