Last active
December 21, 2018 02:50
-
-
Save BoxResin/c5a7fbb1f8e3ac0031ec2cca4663c569 to your computer and use it in GitHub Desktop.
AndroidJUnit4 + Robolectric
This file contains hidden or 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 winapi251.app.schoolmeal | |
import android.content.Context | |
import androidx.test.core.app.ApplicationProvider | |
import androidx.test.ext.junit.runners.AndroidJUnit4 | |
import org.junit.Assert.assertEquals | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
@RunWith(AndroidJUnit4::class) | |
class ExampleInstrumentedTest | |
{ | |
@Test | |
fun useAppContext() | |
{ | |
// Context of the app under test. | |
val appContext: Context = ApplicationProvider.getApplicationContext() | |
assertEquals("winapi251.app.schoolmeal", appContext.packageName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment