I created a simple implementation of a LinkedList (for educative purposes) and I want to test it.
My question is:
How can I test the ADD method or the GET method ?
If I want to test the ADD method I must pretend that GET method works fine. If I want to test the GET method, I must somehow add data to the List (not via Constructor, because then I would need to test that too), hence pretend that ADD method works fine.
(I could introspect the content of the LinkedList with Reflexion, but it's not always the case, and now I want to use only the public API of my LinkedList).
Aucun commentaire:
Enregistrer un commentaire