InterviewSolution
Saved Bookmarks
| 1. |
How Do You Test A “private” Method? |
|
Answer» A private METHOD only be ACCESSED within the same class. So there is no WAY to TEST a “private” method of a target class from any test class. A way out is that you can perform UNIT testing manually or can change your method from “private” to “protected”. A private method only be accessed within the same class. So there is no way to test a “private” method of a target class from any test class. A way out is that you can perform unit testing manually or can change your method from “private” to “protected”. |
|