Test Samples Roboelectric 3.0

I am new to robotic testing. I am trying to complete this post for checking fragments. I use the following dependency

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile "org.robolectric:robolectric:3.0" testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.google.code.gson:gson:2.3' compile 'com.android.support:support-v4:22.1.0' compile 'com.google.android.gms:play-services:7.5.0' 

}

But this import gives me compilation problems, and I cannot resolve the SupportFragmentTestUtil character to start with. Please help me, what am I missing?

 org.robolectric.shadows.support.v4.SupportFragmentTestUtil 
+6
source share
1 answer

You need to add a dependency to support v4 shadows. Add this to the dependency file.

 testCompile "org.robolectric:shadows-support-v4:3.0" 
+11
source

All Articles