Created
May 5, 2015 22:17
-
-
Save akexorcist/43d0663d3aa1a1ce9046 to your computer and use it in GitHub Desktop.
คำอธิบายเกี่ยวกับการเทสแบบต่างๆใน Android
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
TestCase – Plain old JUnit test case. It can be extended to test utility classes that are not tied to the Android framework. | |
AndroidTestCase – It extends JUnit’s TestCase. It’s a lighter testing class compared to ActivityTestCase. It doesn’t need to launch an activity to run it. Its getContext() method allows you to get an injected context if you need one. Since you can get a context from this class, you can inflate your UI objects to test their behaviors. | |
ActivityInstrumentationTestCase2 – It’s the newer version of ActivityInstrumentationTestCase. ActivityInstrumentationTestCase is deprecated in Android SDK 1.5. It’s a heavier testing class compared to AndroidTestCase. It provides UI and functional testing for a single activity. You can get an injected activity that you are testing on by calling its getActivity() method. The activity being tested is launched and finished before and after each test. | |
ActivityUnitTestCase – It gives the tested activity an isolated environment. When using it to test an activity, the activity is not attached to the system. This gives you more control over what kind of environment that you want your activity to be tested in. | |
ApplicationTestCase – It provides testing for Application classes. It can be used to test the life cycle of an application. | |
InstrumentationTestRunner – The runner that runs the Android test cases. | |
I just found this..Hope this helps for others...If u want more details like when and how to use, see the APIDemos test application in the samples directory within android SDK. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment