package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
import android.provider.DocumentsContract;
+import android.text.format.Formatter;
import android.view.View;
import android.widget.FrameLayout;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class MusicViewHolderControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Fragment mFragment;
public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
mController.setupView(mHolder);
- assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
+ assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+ Formatter.formatFileSize(mContext, 0));
}
@Test
mController.queryStats();
mController.setupView(mHolder);
- assertThat(mHolder.mSummary.getText().toString()).isEqualTo("1.00 B");
+ assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+ Formatter.formatFileSize(mContext, 1));
}
@Test
package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Intent;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
+import android.text.format.Formatter;
import android.view.View;
import android.widget.FrameLayout;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PhotosViewHolderControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Fragment mFragment;
- @Mock private StorageStatsSource mSource;
+ @Mock
+ private StorageStatsSource mSource;
private Context mContext;
private PhotosViewHolderController mController;
public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
mController.setupView(mHolder);
- assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
+ assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+ Formatter.formatFileSize(mContext, 0));
}
@Test
mController.queryStats();
mController.setupView(mHolder);
- assertThat(mHolder.mSummary.getText().toString()).isEqualTo("11.00 B");
+ assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
+ Formatter.formatFileSize(mContext, 11));
}
@Test