-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started Espresso Tests, fixed some unit tests, fix gradle wrapper and…
… build files, added animation files, added cipher util. Updated rxredux and gadapter
- Loading branch information
Showing
43 changed files
with
933 additions
and
373 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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Mon Dec 11 16:14:29 CET 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip |
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
40 changes: 40 additions & 0 deletions
40
...p/src/androidTest/java/com/zeyad/usecases/app/screens/RecyclerViewItemCountAssertion.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,40 @@ | ||
package com.zeyad.usecases.app.screens; | ||
|
||
import android.support.test.espresso.NoMatchingViewException; | ||
import android.support.test.espresso.ViewAssertion; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.View; | ||
|
||
import org.hamcrest.Matcher; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
/** | ||
* @author by ZIaDo on 7/31/17. | ||
*/ | ||
public class RecyclerViewItemCountAssertion implements ViewAssertion { | ||
private final Matcher<Integer> matcher; | ||
|
||
private RecyclerViewItemCountAssertion(Matcher<Integer> matcher) { | ||
this.matcher = matcher; | ||
} | ||
|
||
public static RecyclerViewItemCountAssertion withItemCount(int expectedCount) { | ||
return withItemCount(is(expectedCount)); | ||
} | ||
|
||
public static RecyclerViewItemCountAssertion withItemCount(Matcher<Integer> matcher) { | ||
return new RecyclerViewItemCountAssertion(matcher); | ||
} | ||
|
||
@Override | ||
public void check(View view, NoMatchingViewException noViewFoundException) { | ||
if (noViewFoundException != null) { | ||
throw noViewFoundException; | ||
} | ||
RecyclerView recyclerView = (RecyclerView) view; | ||
RecyclerView.Adapter adapter = recyclerView.getAdapter(); | ||
assertThat(adapter.getItemCount(), matcher); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...eApp/src/androidTest/java/com/zeyad/usecases/app/screens/splash/UserListActivityTest.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,19 @@ | ||
package com.zeyad.usecases.app.screens.splash; | ||
|
||
import android.support.test.rule.ActivityTestRule; | ||
import android.test.suitebuilder.annotation.LargeTest; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
@LargeTest | ||
//@RunWith(AndroidJUnit4.class) | ||
public class UserListActivityTest { | ||
|
||
@Rule | ||
public ActivityTestRule<SplashActivity> mActivityTestRule = new ActivityTestRule<>(SplashActivity.class); | ||
|
||
@Test | ||
public void userListActivityTest() { | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...c/androidTest/java/com/zeyad/usecases/app/screens/user/detail/UserDetailFragmentTest.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,47 @@ | ||
package com.zeyad.usecases.app.screens.user.detail; | ||
|
||
import android.content.Intent; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.rule.ActivityTestRule; | ||
|
||
import com.zeyad.usecases.app.screens.user.list.User; | ||
|
||
import org.junit.Rule; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author by ZIaDo on 8/1/17. | ||
*/ | ||
public class UserDetailFragmentTest { | ||
private User user; | ||
private List<Repository> repositories; | ||
@Rule | ||
public ActivityTestRule<UserDetailActivity> mActivityTestRule = new ActivityTestRule<UserDetailActivity>( | ||
UserDetailActivity.class) { | ||
@Override | ||
protected Intent getActivityIntent() { | ||
return UserDetailActivity.getCallingIntent( | ||
InstrumentationRegistry.getInstrumentation().getTargetContext(), UserDetailState.builder() | ||
.setIsTwoPane(false).setRepos(mockRepos()).setUser(mockUser().getLogin()).build()); | ||
} | ||
}; | ||
|
||
private User mockUser() { | ||
user = new User(); | ||
user.setAvatarUrl("https://avatars2.githubusercontent.com/u/5938141?v=3"); | ||
user.setId(5938141); | ||
user.setLogin("Zeyad-37"); | ||
return user; | ||
} | ||
|
||
private List<Repository> mockRepos() { | ||
repositories = new ArrayList<>(); | ||
Repository repository = new Repository(); | ||
repository.setId(1); | ||
repository.setName("Repo"); | ||
repository.setOwner(user); | ||
return repositories; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
.../androidTest/java/com/zeyad/usecases/app/screens/user/detail/UserDetailFragmentTest2.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,37 @@ | ||
package com.zeyad.usecases.app.screens.user.detail; | ||
|
||
import com.android21buttons.fragmenttestrule.FragmentTestRule; | ||
import com.zeyad.usecases.app.screens.user.list.User; | ||
|
||
import org.junit.Rule; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author by ZIaDo on 8/1/17. | ||
*/ | ||
public class UserDetailFragmentTest2 { | ||
@Rule | ||
public FragmentTestRule<?, UserDetailFragment> fragmentTestRule = | ||
FragmentTestRule.create(UserDetailFragment.class); | ||
private User user; | ||
private List<Repository> repositories; | ||
|
||
private User mockUser() { | ||
user = new User(); | ||
user.setAvatarUrl("https://avatars2.githubusercontent.com/u/5938141?v=3"); | ||
user.setId(5938141); | ||
user.setLogin("Zeyad-37"); | ||
return user; | ||
} | ||
|
||
private List<Repository> mockRepos() { | ||
repositories = new ArrayList<>(); | ||
Repository repository = new Repository(); | ||
repository.setId(1); | ||
repository.setName("Repo"); | ||
repository.setOwner(user); | ||
return repositories; | ||
} | ||
} |
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
Oops, something went wrong.