-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
1,176 additions
and
766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
app/src/androidTest/java/saulmm/avengers/ApplicationTest.java
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
app/src/androidTest/java/saulmm/avengers/tests/CharacterListActivityInstrumentationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package saulmm.avengers.tests; | ||
|
||
import android.content.Intent; | ||
import android.support.test.espresso.Espresso; | ||
import android.support.test.espresso.contrib.RecyclerViewActions; | ||
import android.support.test.espresso.intent.Intents; | ||
import android.support.test.espresso.intent.rule.IntentsTestRule; | ||
import android.support.test.espresso.matcher.ViewMatchers; | ||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.LargeTest; | ||
import android.util.Log; | ||
import android.widget.TextView; | ||
|
||
import com.squareup.okhttp.mockwebserver.Dispatcher; | ||
import com.squareup.okhttp.mockwebserver.MockResponse; | ||
import com.squareup.okhttp.mockwebserver.MockWebServer; | ||
import com.squareup.okhttp.mockwebserver.RecordedRequest; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import javax.inject.Inject; | ||
|
||
import saulmm.avengers.R; | ||
import saulmm.avengers.TestData; | ||
import saulmm.avengers.injector.components.DaggerAvengersComponent; | ||
import saulmm.avengers.injector.modules.ActivityModule; | ||
import saulmm.avengers.repository.CharacterRepository; | ||
import saulmm.avengers.rest.RestDataSource; | ||
import saulmm.avengers.views.activities.CharacterDetailActivity; | ||
import saulmm.avengers.views.activities.CharacterListActivity; | ||
|
||
import static android.support.test.espresso.Espresso.*; | ||
import static android.support.test.espresso.action.ViewActions.click; | ||
import static android.support.test.espresso.assertion.ViewAssertions.matches; | ||
import static android.support.test.espresso.intent.Intents.intended; | ||
import static android.support.test.espresso.intent.Intents.times; | ||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; | ||
import static android.support.test.espresso.matcher.ViewMatchers.*; | ||
import static android.support.test.espresso.matcher.ViewMatchers.withId; | ||
import static org.hamcrest.CoreMatchers.allOf; | ||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@LargeTest | ||
@RunWith(AndroidJUnit4.class) | ||
public class CharacterListActivityInstrumentationTest { | ||
private MockWebServer mMockWebServer; | ||
|
||
@Rule public ActivityTestRule<CharacterListActivity> mCharacterListIntentRule = | ||
new ActivityTestRule<>(CharacterListActivity.class, true, false); | ||
|
||
@Before public void setUp() throws Exception { | ||
mMockWebServer = new MockWebServer(); | ||
mMockWebServer.start(); | ||
|
||
RestDataSource.END_POINT = mMockWebServer.getUrl("/").toString(); | ||
} | ||
|
||
@Test public void showCharacters() { | ||
mMockWebServer.enqueue(new MockResponse().setBody(TestData.TWENTY_CHARACTERS_JSON)); | ||
|
||
mCharacterListIntentRule.launchActivity(null); | ||
|
||
onView(withId(R.id.activity_avengers_recycler)).check(matches(isDisplayed())); | ||
} | ||
|
||
@After public void tearDown() throws Exception { | ||
mMockWebServer.shutdown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
app/src/main/java/saulmm/avengers/domain/GetCharacterInformationUsecase.java
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
app/src/main/java/saulmm/avengers/domain/GetCharactersUsecase.java
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
app/src/main/java/saulmm/avengers/domain/GetCollectionUsecase.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.