Hi, i am having two issues when doing Junit testing on my code. the first issue is i cant seem to unit test a private method or class and was wondering if its possible to do so.
the second issue is that i have setup a seperate android project for doing all the testing and have just added the main project into its build path so i can call methods from the main android project i am testing on. Whenever i call something from the main project ie Myclass myclass = new Myclass(); it fails saying that the Test Run failed with a java.lang.Verify error
i am simply creating a new class object from my main project into my AndroidTestCase class so im not quite sure what the issue is.
i am basicly having the exact same issue as someone in this link http://dtmilano.blogspot.com/2009/07/an ... _4442.html
who has posted a comment about it
Here below is the original comment made by someone with the same issue i have.
hey diego, i'm trying to create a unit test by following your tutorial. I've arrived in which i created a test method for one of my class (called MyClass for example) which resides in my main package (say, com.package.main). And yes, I've put my main project in the test build path configuration.
And then, I tried to create the class in one of my test case in a usual manner of:
MyClass myClass = new MyClass()
And then I tried to run the test project and it always gives Test run failed messages. This happens eveytime I wanted to instantiate any class that resides in my main project. Can you help me on this? Thanks in advance
Anyways, thanks for your time in reading this and im hoping someone here can help me as i really want to create a seperate project with all my Testcase's and TestSuits instead of including them in the main project. I also do not want to make my private class and methods public just for Unit testing.
Thanks again and looking forward to some of your advice.