diff options
Diffstat (limited to 'tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java')
-rw-r--r-- | tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java b/tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java index c8c782055..1b419cee8 100644 --- a/tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java +++ b/tests/src/com/android/dialer/filterednumber/MigrateBlockedNumbersDialogFragmentTest.java @@ -19,7 +19,10 @@ package com.android.dialer.filterednumber; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; -import com.android.dialer.filterednumber.MigrateBlockedNumbersDialogFragment.Listener; +import com.android.dialer.filterednumber.BlockedNumbersMigrator.Listener; + +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** @@ -28,18 +31,31 @@ import com.android.dialer.filterednumber.MigrateBlockedNumbersDialogFragment.Lis @SmallTest public class MigrateBlockedNumbersDialogFragmentTest extends AndroidTestCase { - public void testNewInstance_NullMigrationListener() { + @Mock private BlockedNumbersMigrator mBlockedNumbersMigrator; + @Mock private Listener mListener; + + @Override + public void setUp() throws Exception { + super.setUp(); + MockitoAnnotations.initMocks(this); + } + + public void testNewInstance_NullMigrator() { + try { + MigrateBlockedNumbersDialogFragment.newInstance(null, mListener); + fail(); + } catch (NullPointerException e) {} + } + + public void testNewInstance_NullListener() { try { - MigrateBlockedNumbersDialogFragment.newInstance(null); + MigrateBlockedNumbersDialogFragment.newInstance(mBlockedNumbersMigrator, null); fail(); } catch (NullPointerException e) {} } public void testNewInstance_WithListener() { - assertNotNull(MigrateBlockedNumbersDialogFragment.newInstance( - new Listener() { - @Override - public void onComplete() {} - })); + assertNotNull(MigrateBlockedNumbersDialogFragment.newInstance(mBlockedNumbersMigrator, + mListener)); } } |