mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 06:13:54 +01:00
* *.kt: bulk correction of formatting using ktlint --format * *.kt: replace wildcard imports and second stage auto format ktlint --format * QuizQuestionTest.kt: modified property names to camel case to meet ktlint standard * LevelControllerTest.kt: modified property names to camel case to meet ktlint standard * QuizActivityUnitTest.kt: modified property names to camel case to meet ktlint standard * MediaDetailFragmentUnitTests.kt: modified property names to camel case to meet ktlint standard * UploadWorker.kt: modified property names to camel case to meet ktlint standard * UploadClient.kt: modified property names to camel case to meet ktlint standard * BasePagingPresenter.kt: modified property names to camel case to meet ktlint standard * DescriptionEditActivity.kt: modified property names to camel case to meet ktlint standard * OnSwipeTouchListener.kt: modified property names to camel case to meet ktlint standard * MediaDetailFragmentUnitTests.kt: corrected excessive line length to meet ktlint standard * DepictedItem.kt: corrected property name format and catch format to for ktlint standard * UploadCategoryAdapter.kt: corrected class definition format to meet ktlint standard * CustomSelectorActivity.kt: reformatted function names to first letter lowercase to meet ktlint standard * MediaDetailFragmentUnitTests.kt: fix string literal indentation to meet ktlint standard * NotForUploadDao.kt: file renamed to match class name, new file NotForUploadStatusDao.kt * UploadedDao.kt: file renamed to match class name, new file UploadedStatusDao.kt * Urls.kt: fixed excessive line length for ktLint standard * Snak_partial.kt & Statement_partial.kt: refactored to remove underscores in class names to meet ktLint standard * *.kt: fixed consecutive KDOC error for ktLint * PageableBaseDataSourceTest.kt & UploadPresenterTest.kt: fixed excessive line lengths to meet ktLint standard * CheckboxTriStatesTest.kt: renamed file to match class name to meet ktLint standard * .kt: resolved backing-property-naming error in ktLint, made matching properties public, matched names and refactored * TestConnectionFactory.kt: fixed property naming to adhere to ktLint standard
28 lines
817 B
Kotlin
28 lines
817 B
Kotlin
package fr.free.nrw.commons
|
|
|
|
import org.junit.Test
|
|
import org.junit.jupiter.api.Assertions
|
|
import java.util.Calendar
|
|
|
|
class UtilsTest {
|
|
@Test
|
|
fun wikiLovesMonumentsYearBeforeSeptember() {
|
|
val cal = Calendar.getInstance()
|
|
cal.set(2022, Calendar.FEBRUARY, 1)
|
|
Assertions.assertEquals(2021, Utils.getWikiLovesMonumentsYear(cal))
|
|
}
|
|
|
|
@Test
|
|
fun wikiLovesMonumentsYearInSeptember() {
|
|
val cal = Calendar.getInstance()
|
|
cal.set(2022, Calendar.SEPTEMBER, 1)
|
|
Assertions.assertEquals(2022, Utils.getWikiLovesMonumentsYear(cal))
|
|
}
|
|
|
|
@Test
|
|
fun wikiLovesMonumentsYearAfterSeptember() {
|
|
val cal = Calendar.getInstance()
|
|
cal.set(2022, Calendar.DECEMBER, 1)
|
|
Assertions.assertEquals(2022, Utils.getWikiLovesMonumentsYear(cal))
|
|
}
|
|
}
|