Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
TEACHING-MATERIALS/Week_01_Android_Studio/HelloMe/app/src/androidTest/java/com/example/jianhuayang/hellome/ExampleInstrumentedTest.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (21 sloc)
766 Bytes
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
package com.example.jianhuayang.hellome; | |
import android.content.Context; | |
import android.support.test.InstrumentationRegistry; | |
import android.support.test.runner.AndroidJUnit4; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import static org.junit.Assert.*; | |
/** | |
* Instrumentation test, which will execute on an Android device. | |
* | |
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | |
*/ | |
@RunWith(AndroidJUnit4.class) | |
public class ExampleInstrumentedTest { | |
@Test | |
public void useAppContext() throws Exception { | |
// Context of the app under test. | |
Context appContext = InstrumentationRegistry.getTargetContext(); | |
assertEquals("com.example.jianhuayang.hellome", appContext.getPackageName()); | |
} | |
} |