Merge "Omit using ctor of PreferenceViewHolder in tests." into oc-dev
This commit is contained in:
@@ -52,7 +52,7 @@ public class RestrictedPreferenceHelperTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mViewHolder = new PreferenceViewHolder(mock(View.class));
|
mViewHolder = PreferenceViewHolder.createInstanceForTests(mock(View.class));
|
||||||
mHelper = new RestrictedPreferenceHelper(mContext, mPreference, null);
|
mHelper = new RestrictedPreferenceHelper(mContext, mPreference, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class TwoTargetPreferenceTest {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mContext = RuntimeEnvironment.application;
|
mContext = RuntimeEnvironment.application;
|
||||||
mPreference = spy(new TwoTargetPreference(mContext));
|
mPreference = spy(new TwoTargetPreference(mContext));
|
||||||
mViewHolder = new PreferenceViewHolder(mock(View.class));
|
mViewHolder = PreferenceViewHolder.createInstanceForTests(mock(View.class));
|
||||||
when(mViewHolder.findViewById(R.id.two_target_divider))
|
when(mViewHolder.findViewById(R.id.two_target_divider))
|
||||||
.thenReturn(mDivider);
|
.thenReturn(mDivider);
|
||||||
when(mViewHolder.findViewById(android.R.id.widget_frame))
|
when(mViewHolder.findViewById(android.R.id.widget_frame))
|
||||||
|
|||||||
Reference in New Issue
Block a user