Commit graph

78 commits

Author SHA1 Message Date
TacoTheDank
9ccd358cb8 Update ktlint to 0.43.2 2021-12-04 21:22:29 -05:00
litetex
ba7ceab2a4 Added tests for the `TimestampExtractor` 2021-08-06 22:09:03 +02:00
Stypox
05e2c4898b Add tests for play queue items' equals() 2021-07-21 18:22:17 +02:00
Stypox
460d2aa82f Fix ContentSettingsManager tests 2021-06-08 10:40:45 +02:00
Stypox
84709eb620 Revert all commits related to ContentSettingsFragment
Revert "Annotate methode parameters as NonNull"
This reverts commit af92c3ed4f.

Revert "Commit path immediately when import backup"
This reverts commit c3d9c4bb3f.

Revert "Set ImportExportDataPath only on successful import"
This reverts commit a4bc61a7d0.

Revert "Set ImportExportDataPath only on successful export"
This reverts commit 372d7a7832.

Revert "Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability"
This reverts commit 2877c43ecb.

Revert "Move ContentSettingsFragment.isValidPath to helpers and add unit test for it."
This reverts commit 15873d53c4.

Revert "Save backup import/export location for feature import/exports"
This reverts commit 01f05e2f46.

Remove FilePathHelperTest file
2021-06-08 10:40:44 +02:00
TobiGr
d0a76d7e60 Use reqireContext(), requireActivity() instead of getters 2021-06-05 16:13:12 +02:00
Zhiheng Xu
fb8896e634 Remove Enclosed.class runner
Does not affect Gradle tests and only benefits IDE workflow
2021-05-24 13:03:52 -04:00
Zhiheng Xu
b8c6043569 Rewrite addToHistory test without using reflection 2021-05-24 12:20:19 -04:00
Zhiheng Xu
b153b5954d Rename mockPlayQueue(…) to makePlayQueue(…) 2021-05-24 12:20:19 -04:00
Zhiheng Xu
0633e93dce Add test for setIndex 2021-05-24 12:20:19 -04:00
Zhiheng Xu
4952483013 Refactor static methods to package private
Stops Android Studio from "recognizing" them as tests
2021-05-24 12:20:19 -04:00
Eric Xu
f9582a3d59 Test getItem(int) 2021-05-24 12:20:19 -04:00
Eric Xu
14e8fe51d0 Refactor making a PlayQueueItem to static method 2021-05-24 12:20:19 -04:00
Eric Xu
9181930625 Test PlayQueue.setIndex(...) 2021-05-24 12:20:19 -04:00
Eric Xu
24b02a2dbd Test PlayQueue equals 2021-05-24 12:20:19 -04:00
XiangRongLin
7dd0c348de Remove unnecessary conversion between file and path 2021-05-21 20:24:11 +02:00
Alireza Tofighi
a880050487 Split up FilePathHelperTest tests in simpler methods 2021-05-21 22:44:38 +04:30
Alireza Tofighi
86d1ce314e Add more tests for FilePathUtils.isValidDirectoryPath for better coverage 2021-05-21 20:28:42 +04:30
Alireza Tofighi
15873d53c4 Move ContentSettingsFragment.isValidPath to helpers and add unit test for it. 2021-05-21 20:21:58 +04:30
krlvm
6069d74311 Fix error in tests 2021-03-27 18:11:39 +03:00
Isira Seneviratne
220bf61e8e Use PrettyTime's new formatUnrounded(OffsetDateTime) method.
Also change the types of the relevant variables from Calendar to OffsetDateTime.
2021-03-18 06:38:12 +05:30
Stypox
bb398189d6 Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
XiangRongLin
22dad3dc9d Respect expires header when checking for new version
It was called to many times and acted similar to a DOS attack.
2021-01-23 09:02:11 +01:00
Stypox
8ad9661aff Merge pull request #5225 from XiangRongLin/extract_settings_import
Extract settings import
2021-01-14 15:18:36 +01:00
Stypox
747d629732 Merge pull request #4947 from Isira-Seneviratne/Convert_ExceptionUtils_to_extensions
Rewrite ExceptionUtils methods as extension functions.
2021-01-14 14:54:37 +01:00
XiangRongLin
88346df803 Add comment about unexpected assertion 2021-01-13 17:25:00 +01:00
Isira Seneviratne
6d4931e77a Add extension functions that accept reified types. 2021-01-11 16:49:46 +05:30
Isira Seneviratne
4d59466977 Rewrite ExceptionUtils methods as extension functions. 2021-01-11 16:49:45 +05:30
XiangRongLin
6a03ac88d3 Make Localization.relativeTime testable
Problem is global state in static variable prettyTime. But for performance reasons on Android that is preferred.
Now allow injecting prettyTime dependency by making init function public.
2021-01-06 14:48:34 +01:00
XiangRongLin
417f791973 cleanup 2021-01-03 20:32:16 +01:00
XiangRongLin
7971a468f6 Fix ensureDbDirectoryExists 2021-01-03 20:32:16 +01:00
XiangRongLin
1e632c3d69 Extract settings file deletion 2021-01-03 20:32:16 +01:00
XiangRongLin
e7022ccc94 Remove subclasses from ContentSettingsManagerTest
ExportTest provides no value.
ImportTest creates temporary files even if not needed.
2021-01-03 20:32:16 +01:00
XiangRongLin
2a3198de66 Introduce NewPipeFileLocator class 2021-01-03 20:32:16 +01:00
XiangRongLin
a5f20a3795 Add basic tests for settings import 2021-01-03 20:32:16 +01:00
XiangRongLin
09d7c2289c Adjust ExportTest to new DI with FileLocator 2021-01-03 20:32:16 +01:00
Stypox
3f5b070056 Merge pull request #5204 from XiangRongLin/fix_before_all
Use @BeforeClass for ContentSettingsManagerTest.beforeClass
2020-12-19 14:33:37 +01:00
Stypox
7feb07e686 Merge pull request #5208 from Stypox/recaptcha-pbj
Remove pbj=1 parameter from YouYube urls in recaptcha activity
2020-12-18 18:28:44 +01:00
Stypox
14584b2f12 Remove pbj=1 parameter from YouYube urls in recaptcha activity 2020-12-17 21:02:13 +01:00
XiangRongLin
8455bafdef Use @BeforeClass for ContentSettingsManagerTest.beforeClass 2020-12-17 09:40:04 +01:00
Stypox
8ef61f2765 Merge pull request #5059 from XiangRongLin/content_settings_manager
Extract export database logic into own class
2020-12-15 10:34:32 +01:00
Stypox
342a003cd2 Show radio instead of Youtube logo in mixes
YouTube mixes have YouTube as a creator, though YouTube's logo is not safe to use as it is a trademark (better safe than sorry)
2020-12-14 19:22:00 +01:00
Isira Seneviratne
9d045db71f Add a workaround for a possible null offset ID. 2020-12-10 15:23:30 +05:30
Tobias Groza
2796608428 Merge pull request #4961 from TeamNewPipe/lint
Fix some Lint errors
2020-12-07 11:19:01 +01:00
XiangRongLin
dc7f2bf894 Extract export database logic into own class
- Separate it from the UI.
- Add happy path unit test.
2020-12-04 18:30:29 +01:00
Stypox
34dd7c0fbf Update most dependencies 2020-11-22 14:03:10 +01:00
TobiGr
397ca000e3 Fix typos 2020-11-22 10:39:00 +01:00
TacoTheDank
0b41bd4699 Lint: 'size() == 0' replaceable with 'isEmpty()' 2020-11-18 17:54:16 -05:00
wb9688
25b56bf5e4 Use final where possible 2020-08-16 10:25:09 +02:00
wb9688
d770cf5657 Auto-format using Ktlint 2020-05-01 20:13:21 +02:00