Need help to write a unit test using Mockito and JUnit4
问题 Need help to write a unit test for the below code using Mockito and JUnit4, public class MyFragmentPresenterImpl { public Boolean isValid(String value) { return !(TextUtils.isEmpty(value)); } } I tried below method: MyFragmentPresenter mMyFragmentPresenter @Before public void setup(){ mMyFragmentPresenter=new MyFragmentPresenterImpl(); } @Test public void testEmptyValue() throws Exception { String value=null; assertFalse(mMyFragmentPresenter.isValid(value)); } but it returns following