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:
A200073727 2023-04-14 14:22:48 +05:30 committed by Andy Scherzinger
parent 5787fcba14
commit 6d5d7bf5a1
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 39 additions and 2 deletions

View file

@ -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();
}

View 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")
}
}