Created
October 6, 2015 13:41
-
-
Save fatorx/a261977169a639fa6d41 to your computer and use it in GitHub Desktop.
Android - Error Public Constructor in Instrumentation TestCase
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
Error desc: | |
junit.framework.AssertionFailedError: Class fatorx.com.br.testdriven.MainActivityTest has no public constructor | |
TestCase(String name) or TestCase() | |
When creating the test class, and automatically implemented in some cases the constructor as follows below: | |
public MainActivityTest(Class<MainActivity> activityClass) { | |
super(activityClass); | |
} | |
The solution for this error is the following: create a constructor as follows: | |
public MainActivityTest() { | |
super(MainActivity.class); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment