mirror of
https://github.com/hmalik144/EasyCC_Master.git
synced 2026-03-18 07:26:16 +00:00
New Commit with testing files updated
This commit is contained in:
@@ -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