#3843 Unit Test DepictedItem - add tests (#3844)

This commit is contained in:
Seán Mac Gillicuddy 2020-06-25 07:59:50 +01:00 committed by GitHub
parent 7cfa8078f4
commit bf4b7e2efc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 243 additions and 2 deletions

View file

@ -36,7 +36,7 @@ data class DepictedItem constructor(
place.longDescription
)
constructor(entity: Entities.Entity, name: String, description: String) : this(
private constructor(entity: Entities.Entity, name: String, description: String) : this(
name,
description,
entity[IMAGE].primaryImageValue?.let {
@ -69,7 +69,7 @@ private fun List<Statement_partial>?.toIds(): List<String> {
}
private val List<Statement_partial>?.primaryImageValue: DataValue.ValueString?
get() = this?.first()?.mainSnak?.dataValue as? DataValue.ValueString
get() = this?.firstOrNull()?.mainSnak?.dataValue as? DataValue.ValueString
operator fun Entities.Entity.get(property: WikidataProperties) =
statements?.get(property.propertyName)