Move away from deprecated FakeFeatureFactory.setupForTest()
Test: rerun Change-Id: I896ba414315ddb1664c0499264f4992f0554ef98
This commit is contained in:
@@ -52,21 +52,20 @@ public class PhoneLanguagePreferenceControllerTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
FakeFeatureFactory.setupForTest(mContext);
|
||||
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
|
||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
mController = new PhoneLanguagePreferenceController(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable_hasMultipleLocales_shouldReturnTrue() {
|
||||
when(mContext.getAssets().getLocales()).thenReturn(new String[]{"en", "de"});
|
||||
when(mContext.getAssets().getLocales()).thenReturn(new String[] {"en", "de"});
|
||||
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable_hasSingleLocales_shouldReturnFalse() {
|
||||
when(mContext.getAssets().getLocales()).thenReturn(new String[]{"en"});
|
||||
when(mContext.getAssets().getLocales()).thenReturn(new String[] {"en"});
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class UserDictionaryPreferenceControllerTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
FakeFeatureFactory.setupForTest(mContext);
|
||||
FakeFeatureFactory.setupForTest();
|
||||
mController = new TestController(mContext);
|
||||
mPreference = new Preference(ShadowApplication.getInstance().getApplicationContext());
|
||||
}
|
||||
|
Reference in New Issue
Block a user