mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Fixed imports in existing test cases.
Commit id- 0db2944
from branch feature/NMC-832
Fixed imports in existing test cases.
This commit is contained in:
parent
5787fcba14
commit
6d5d7bf5a1
2 changed files with 39 additions and 2 deletions
|
@ -23,6 +23,8 @@ package com.nextcloud.client.preferences;
|
|||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.utils.FileSortOrder;
|
||||
import com.nmc.android.app_review.AppReviewShownModel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
|
@ -377,6 +379,9 @@ public interface AppPreferences {
|
|||
boolean isStoragePermissionRequested();
|
||||
|
||||
void setStoragePermissionRequested(boolean value);
|
||||
void setHideVideoClicked(boolean isHideVideoClicked);
|
||||
boolean getHideVideoClicked();
|
||||
|
||||
void setInAppReviewData(@NonNull AppReviewShownModel appReviewShownModel);
|
||||
|
||||
@Nullable
|
||||
AppReviewShownModel getInAppReviewData();
|
||||
}
|
||||
|
|
32
app/src/test/java/com/nmc/android/utils/ExtensionTest.kt
Normal file
32
app/src/test/java/com/nmc/android/utils/ExtensionTest.kt
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.nmc.android.utils
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class ExtensionsTest {
|
||||
|
||||
@Test
|
||||
fun isCurrentYear_checkForAllConditions() {
|
||||
assertFalse(System.currentTimeMillis().isCurrentYear(""))
|
||||
assertFalse(System.currentTimeMillis().isCurrentYear(null))
|
||||
|
||||
val year2022TimeMills = 1652892268000L
|
||||
assertTrue(year2022TimeMills.isCurrentYear("2022"))
|
||||
|
||||
assertFalse(year2022TimeMills.isCurrentYear("2021"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getFormattedStringDate_checkForAllConditions() {
|
||||
val year2022TimeMills = 1652892268000L
|
||||
val actualYearValue = year2022TimeMills.getFormattedStringDate("yyyy")
|
||||
assertTrue(actualYearValue == "2022")
|
||||
assertFalse(actualYearValue == "2021")
|
||||
assertFalse(actualYearValue == "")
|
||||
|
||||
val actualYearNewValue = year2022TimeMills.getFormattedStringDate("")
|
||||
assertTrue(actualYearNewValue == "")
|
||||
assertFalse(actualYearNewValue == "2022")
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue