Something I had to learn the hard way when unit testing in Android.
When using this tutorial for testing in Android: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html
Something that they don’t tell you is to you must declare that the methods are tests. Well since I was also used to adding attributes to C# tests in Visual Studio. You don’t have attributes in java. Sadly.
So whats the next step in declaring that your method is a test?
public void testAssertions(){}
You must declare it in the syntax. By preceding the method name with the word “test” like the method above, you declare that it is a test. I know, this sounds stupid and the darn tutorial doesn’t even explain that this is required, but it is. This little problem took me a day to figure out.
Some errors I received because of this little problem are below:
Test run failed: Test run incomplete. Expected 1 tests, received 0.