Skip to main content

Posts

Showing posts with the label junit

differences between 2 JUnit Assert classes

I've noticed that the JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is? The classes I'm referring to are: junit.framework.Assert and org.junit.Assert . Cheers, Don

Robotium side scroll not working for me

I want to scroll left/right on an android application using a Robotium/Junit test. There is a function in Robotium called: solo.scrollToSide(int); But, what do I put for the int? what is the value for RIGHT and what is the value for LEFT? I tried 0,1,2,3, and 4... no luck :( Thanks EDIT: I found the answer. RIGHT is 22 and LEFT is 21.

How should I be creating classes when doing TDD

I have started doing TDD and I am unsure if I am doing it correctly. I have made a Question class and a QuestionTest. The Question class has an addAnswer method that takes an instance of the Answer class. Now, should I be creating only the class Answer and use the default constructor. Or should I be making the Answer class and also provide the constructor with parameters? question.addAnswer(new Answer("Some", "Argument that I know I will use")); or: question.addAnswer(new Answer()); It is probably the last one where I write only as much as I need to proceed.