mirror of
https://github.com/hmalik144/EasyCC_Master.git
synced 2025-12-10 03:05:29 +00:00
New Commit with testing files updated
This commit is contained in:
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,12 +1,12 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
compileSdkVersion 27
|
||||
buildToolsVersion '27.0.3'
|
||||
defaultConfig {
|
||||
applicationId "com.appttude.h_mal.easycc"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 26
|
||||
targetSdkVersion 27
|
||||
versionCode 2
|
||||
versionName "1.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
@@ -17,14 +17,18 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||||
implementation 'com.android.support:cardview-v7:26.1.0'
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
androidTestImplementation 'com.android.support.test:rules:1.0.2'
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.appttude.h_mal.easycc;
|
||||
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.view.View;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class MainActivityTest {
|
||||
|
||||
@Rule
|
||||
public ActivityTestRule<MainActivity> activityActivityTestRule = new ActivityTestRule<MainActivity>(MainActivity.class);
|
||||
|
||||
private MainActivity mainActivity = null;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
mainActivity = activityActivityTestRule.getActivity();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testViews(){
|
||||
View view = mainActivity.findViewById(R.id.editText);
|
||||
|
||||
assertNotNull(view);
|
||||
}
|
||||
|
||||
@After
|
||||
public void TearDown() throws Exception{
|
||||
mainActivity = null;
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,6 @@ public class PublicMethods {
|
||||
s1 = s1.substring(0,3);
|
||||
s2 = s2.substring(0,3);
|
||||
|
||||
Log.i(TAG, "UriBuilder: " + s1 + "_" + s2);
|
||||
|
||||
Uri baseUri = Uri.parse(URL);
|
||||
Uri.Builder builder = baseUri.buildUpon();
|
||||
builder.appendQueryParameter("q", s1 + "_" + s2)
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
package com.appttude.h_mal.easycc;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static com.appttude.h_mal.easycc.PublicMethods.UriBuilder;
|
||||
import static com.appttude.h_mal.easycc.PublicMethods.createUrl;
|
||||
import static com.appttude.h_mal.easycc.PublicMethods.makeHttpRequest;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
@@ -10,8 +21,11 @@ import static org.junit.Assert.*;
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void addition_isCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user