Pointdexter Huynh wrote:I honestly don't understand what to do with the while loop and how to find even and odd numbers.
Pointdexter Huynh wrote:
2. Output all the even numbers between firstNum and secondNum...
Junilu Lacar wrote:There's no rule that says all your tests for one particular class have to be in one unit test class. So, my approach would be to separate whitebox tests from blackbox tests. This way, if your implementation changes, only the test class with the whitebox tests needs to be changed.
Conrado Sanchez wrote:The number of Contact that I input is just one when I run the program so the Number of contacts: 1 is correct, but it gives me workbook.Contact@46e5590e instead of printing out all the contacts stored inside the Contact class. Yes I do loop through the ArrayList and I also have a method inside the Contact class, the printNameAndPhone(), which prints out the name as well as the phone number but how do I incorporate the printNameAndPhone() method (located in the Contact class) inside the print() method (located inside the AddressBook class)???
Basically I'm asking how to access all the elements in the ArrayList<Contact> addressBook = new ArrayList<>();??
Time Cooke wrote:It depends on what you define as a unit. If your ImplementationClass, A, B, and C all work together to perform a single 'unit' of functionality in your application then you might want to test them all together using the production versions of each class.
Tim Cooke wrote:Your tests should describe a function in terms of your problem domain, not in terms of the implementation
Yegor Bugayenko wrote:As a rule of thumb, try to stay as far away from mocking frameworks, as you can.
Yegor Bugayenko wrote:Instead of mocking it's better to use fake objects. I've published an article on this subject a few weeks ago