Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Integrating Robolectric 3 with Android Studio 2
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
package com.greenlifesoftware.robolectricpractice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import static org.junit.Assert.assertNotNull;
@Config(constants = BuildConfig.class, sdk = 21)
public class RobolectricActivityTest
public void shouldNotBeNull()
RobolectricActivity activity = Robolectric.setupActivity( RobolectricActivity.class );

This comment has been minimized.

Copy link

@graffiti75 graffiti75 commented Jul 25, 2019

I tried running, but it is not working. Check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.