mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-23 12:51:16 +00:00
Update FoldersAdapter unit test
This commit is contained in:
parent
fadd22148a
commit
87f3ea9687
2 changed files with 5 additions and 4 deletions
|
@ -32,9 +32,10 @@ public class FoldersAdapterTest extends AndroidTestCase {
|
||||||
mFolder.ReadOnly = false;
|
mFolder.ReadOnly = false;
|
||||||
mFolder.Versioning = new RestApi.Versioning();
|
mFolder.Versioning = new RestApi.Versioning();
|
||||||
|
|
||||||
|
mModel.state = "idle";
|
||||||
mModel.localFiles = 50;
|
mModel.localFiles = 50;
|
||||||
mModel.globalFiles = 500;
|
mModel.globalFiles = 500;
|
||||||
mModel.localBytes = 1048576;
|
mModel.inSyncBytes = 1048576;
|
||||||
mModel.globalBytes = 1073741824;
|
mModel.globalBytes = 1073741824;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +58,8 @@ public class FoldersAdapterTest extends AndroidTestCase {
|
||||||
assertTrue(items.contains(Long.toString(mModel.localFiles)));
|
assertTrue(items.contains(Long.toString(mModel.localFiles)));
|
||||||
assertTrue(items.contains(Long.toString(mModel.localFiles)));
|
assertTrue(items.contains(Long.toString(mModel.localFiles)));
|
||||||
String size = ((TextView) v.findViewById(R.id.size)).getText().toString();
|
String size = ((TextView) v.findViewById(R.id.size)).getText().toString();
|
||||||
assertTrue(size.contains("1 MB"));
|
assertTrue(size.contains("1 MiB"));
|
||||||
assertTrue(size.contains("1 GB"));
|
assertTrue(size.contains("1 GiB"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -511,7 +511,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a number of bytes to a human readable file size (eg 3.5 GB).
|
* Converts a number of bytes to a human readable file size (eg 3.5 GiB).
|
||||||
*/
|
*/
|
||||||
public static String readableFileSize(Context context, long bytes) {
|
public static String readableFileSize(Context context, long bytes) {
|
||||||
final String[] units = context.getResources().getStringArray(R.array.file_size_units);
|
final String[] units = context.getResources().getStringArray(R.array.file_size_units);
|
||||||
|
|
Loading…
Reference in a new issue