java.lang.ClassCastException: android.app.Application cannot be cast to BLALBLA classAnd if you are using Robolectric 2.+ the way to solve this is to annotate your test with
@Configlike so:
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
@RunWith(RobolectricTestRunner.class) | |
public class MyActivityTest { | |
@Test | |
@Config(manifest="src/main/AndroidManifest.xml") | |
public void shouldTestSomethingAmazing() throws Exception { | |
// Awesome code here | |
} | |
} |
You can annotate also annotate the whole suite.