比如有一个通过用户名登录的android异步接口 LoginManager.loginWithUsername(username, password, new LoginListener(){ @Override public void onLoginResult(boolean isSuccess, User user, Error error) {
}}); } 想针对回调函数中的boolean isSuccess, User user,Error error进行断言,如果直接加断言肯定是行不通的
LoginManager.loginWithUsername(“aaa”, "qqqqq", new LoginListener(){ @Override public void onLoginResult(boolean isSuccess, User user, Error error) { Assert.assertTrue(isSuccess);//会一直执行不到 }}); }