-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from JasonChong96/milestone3
Milestone3
- Loading branch information
Showing
118 changed files
with
6,118 additions
and
2,237 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
language: android | ||
android: | ||
components: | ||
- tools | ||
- tools | ||
- platform-tools | ||
- build-tools-28.0.0 | ||
- android-28 | ||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_f2da1cf98853_key -iv $encrypted_f2da1cf98853_iv | ||
-in Mugger.jks.enc -out Mugger.jks -d | ||
- yes | sdkmanager "platforms;android-28" | ||
- chmod +x gradlew | ||
before_script: | ||
script: | ||
- "./gradlew build" | ||
jdk: | ||
- oraclejdk8 |
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
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.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":26,"versionName":"1.10.7","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
86 changes: 86 additions & 0 deletions
86
app/src/androidTest/java/com/bojio/mugger/Main2ActivityInstrumentalTest.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,86 @@ | ||
package com.bojio.mugger; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.filters.SmallTest; | ||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.util.Log; | ||
import android.widget.TextView; | ||
|
||
import com.bojio.mugger.authentication.GoogleLoginActivity; | ||
import com.bojio.mugger.authentication.MuggerUserCache; | ||
import com.bojio.mugger.database.MuggerDatabase; | ||
import com.google.android.gms.tasks.Task; | ||
import com.google.android.gms.tasks.Tasks; | ||
import com.google.firebase.FirebaseApp; | ||
import com.google.firebase.auth.AuthCredential; | ||
import com.google.firebase.auth.EmailAuthCredential; | ||
import com.google.firebase.auth.EmailAuthProvider; | ||
import com.google.firebase.auth.FirebaseAuth; | ||
import com.google.firebase.auth.GoogleAuthCredential; | ||
import com.google.firebase.auth.UserProfileChangeRequest; | ||
import com.google.firebase.firestore.DocumentReference; | ||
import com.google.firebase.firestore.DocumentSnapshot; | ||
import com.google.firebase.firestore.FirebaseFirestore; | ||
|
||
import org.hamcrest.core.IsNull; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.concurrent.ExecutionException; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class Main2ActivityInstrumentalTest { | ||
private FirebaseFirestore db; | ||
private FirebaseAuth mAuth; | ||
private MuggerUserCache muggerUserCache; | ||
|
||
@Rule | ||
public final ActivityTestRule<Main2Activity> mActivityRule = new ActivityTestRule<>( | ||
Main2Activity.class, true, true); | ||
|
||
@Before | ||
public void setup() { | ||
FirebaseApp.initializeApp(InstrumentationRegistry.getContext()); | ||
mAuth = FirebaseAuth.getInstance(); | ||
db = FirebaseFirestore.getInstance(); | ||
muggerUserCache = MuggerUserCache.getInstance(); | ||
TestUser.login(mAuth, db); | ||
} | ||
|
||
@Test | ||
@SmallTest | ||
public void testSetup() { | ||
Assert.assertNotNull(db); | ||
Assert.assertNotNull(mAuth); | ||
Assert.assertNotNull(muggerUserCache); | ||
} | ||
|
||
@Test | ||
@SmallTest | ||
public void testModules() { | ||
Assert.assertNotNull(muggerUserCache.getModules()); | ||
} | ||
|
||
@Test | ||
@SmallTest | ||
public void testAllModules() { | ||
Assert.assertNotNull(muggerUserCache.getAllModules()); | ||
} | ||
|
||
@Test | ||
@SmallTest | ||
public void testDisplayNameView() { | ||
Assert.assertNotNull(mAuth.getCurrentUser().getDisplayName()); | ||
Assert.assertEquals(((TextView) mActivityRule.getActivity().findViewById(R.id.username)) | ||
.getText(), mAuth.getCurrentUser().getDisplayName()); | ||
Assert.assertEquals(((TextView) mActivityRule.getActivity().findViewById(R.id.email)) | ||
.getText(), mAuth.getCurrentUser().getEmail()); | ||
} | ||
} |
Oops, something went wrong.