use of com.braintreepayments.api.test.UnitTestListenerActivity in project braintree_android by braintree.
the class BraintreeFragmentUnitTest method onResume_postsConfigurationToCallbackForNewActivity.
@Test
public void onResume_postsConfigurationToCallbackForNewActivity() throws InvalidArgumentException {
Configuration configuration = new TestConfigurationBuilder().buildConfiguration();
mockConfigurationManager(configuration);
UnitTestListenerActivity activity = Robolectric.setupActivity(UnitTestListenerActivity.class);
BraintreeFragment fragment = BraintreeFragment.newInstance(activity, TOKENIZATION_KEY);
fragment.onAttach(null);
fragment.onResume();
assertEquals(2, activity.configurations.size());
assertEquals(configuration, activity.configurations.get(0));
assertEquals(configuration, activity.configurations.get(1));
}
use of com.braintreepayments.api.test.UnitTestListenerActivity in project braintree_android by braintree.
the class BraintreeFragmentUnitTest method onResume_doesNotPostConfigurationToCallbackForTheSameActivity.
@Test
public void onResume_doesNotPostConfigurationToCallbackForTheSameActivity() throws InvalidArgumentException {
Configuration configuration = new TestConfigurationBuilder().buildConfiguration();
mockConfigurationManager(configuration);
UnitTestListenerActivity activity = Robolectric.setupActivity(UnitTestListenerActivity.class);
BraintreeFragment fragment = BraintreeFragment.newInstance(activity, TOKENIZATION_KEY);
fragment.onResume();
assertEquals(1, activity.configurations.size());
assertEquals(configuration, activity.configurations.get(0));
}
Aggregations