-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from niscy-eudiw/feature/test/DashboardInteractor
Adds unit tests for DashBoard Interactor.
- Loading branch information
Showing
6 changed files
with
934 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
common-feature/src/main/java/eu/europa/ec/commonfeature/util/TestsConstants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2023 European Commission | ||
* | ||
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European | ||
* Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work | ||
* except in compliance with the Licence. | ||
* | ||
* You may obtain a copy of the Licence at: | ||
* https://joinup.ec.europa.eu/software/page/eupl | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF | ||
* ANY KIND, either express or implied. See the Licence for the specific language | ||
* governing permissions and limitations under the Licence. | ||
*/ | ||
|
||
package eu.europa.ec.commonfeature.util | ||
|
||
import androidx.annotation.VisibleForTesting | ||
import eu.europa.ec.commonfeature.model.DocumentTypeUi | ||
import eu.europa.ec.commonfeature.model.DocumentUi | ||
|
||
@VisibleForTesting(otherwise = VisibleForTesting.NONE) | ||
object TestsConstants { | ||
const val mockedId1 = "000001" | ||
const val mockedId2 = "000002" | ||
const val mockedUserFirstName = "JAN" | ||
const val mockedUserBase64Portrait = "SE" | ||
const val mockedDocUiNamePid = "National ID" | ||
const val mockedDocUiNameMdl = "Driving License" | ||
const val mockedNoUserFistNameFound = "" | ||
const val mockedNoUserBase64PortraitFound = "" | ||
const val mockedNoExpirationDateFound = "-" | ||
const val mockedFormattedExpirationDate = "30 Mar 2050" | ||
|
||
val mockedFullPidUi = DocumentUi( | ||
documentId = mockedId1, | ||
documentName = mockedDocUiNamePid, | ||
documentType = DocumentTypeUi.PID, | ||
documentExpirationDateFormatted = mockedFormattedExpirationDate, | ||
documentImage = "", | ||
documentDetails = emptyList(), | ||
) | ||
|
||
val mockedFullMdlUi = DocumentUi( | ||
documentId = mockedId2, | ||
documentName = mockedDocUiNameMdl, | ||
documentType = DocumentTypeUi.MDL, | ||
documentExpirationDateFormatted = mockedFormattedExpirationDate, | ||
documentImage = "", | ||
documentDetails = emptyList(), | ||
) | ||
|
||
val mockedMdlUiWithNoUserNameAndNoUserImage: DocumentUi = mockedFullMdlUi | ||
|
||
val mockedMdlUiWithNoExpirationDate: DocumentUi = mockedFullMdlUi.copy( | ||
documentExpirationDateFormatted = mockedNoExpirationDateFound | ||
) | ||
|
||
val mockedFullDocumentsUi: List<DocumentUi> = listOf( | ||
mockedFullPidUi, mockedFullMdlUi | ||
) | ||
} |
Oops, something went wrong.