在谷歌sample for intents看着下面的方法:目的stubAllExternalIntents()在咖啡意圖測試
@Before
public void stubAllExternalIntents() {
// By default Espresso Intents does not stub any Intents. Stubbing needs to be setup before
// every test run. In this case all external Intents will be blocked.
intending(not(isInternal())).respondWith(new ActivityResult(Activity.RESULT_OK, null));
}
我看到所有的外部意圖將被阻止,但我不知道這是否方法起什麼作用?
評論清楚地說:「在這種情況下,所有外部意圖都將被阻止。」代碼也似乎這樣做,但你說「它不會阻止這些意圖......」 你能否請進一步解釋? –