Fixed tests

This commit is contained in:
Kanahia 2024-07-08 21:18:07 +05:30
parent a28117397d
commit 0478a9b2ea
5 changed files with 28 additions and 16 deletions

View file

@ -84,9 +84,10 @@ fun place(
category: String = "category",
siteLinks: Sitelinks? = null,
pic: String = "pic",
exists: Boolean = false
exists: Boolean = false,
entityID: String = "entityID"
): Place {
return Place(lang, name, label, longDescription, latLng, category, siteLinks, pic, exists)
return Place(lang, name, label, longDescription, latLng, category, siteLinks, pic, exists, entityID)
}
fun entityId(wikiBaseEntityValue: WikiBaseEntityValue = wikiBaseEntityValue()) =

View file

@ -64,7 +64,7 @@ class BookMarkLocationDaoTest {
examplePlaceBookmark = Place("en", "placeName", exampleLabel, "placeDescription"
, exampleLocation, "placeCategory", builder.build(),"picName",false)
, exampleLocation, "placeCategory", builder.build(),"picName",false, "entityID")
testObject = BookmarkLocationsDao { client }
}

View file

@ -32,7 +32,7 @@ class BookmarkLocationControllerTest {
val list = ArrayList<Place>()
list.add(
Place(
"en", "a place", null, "a description", null, "a cat", null, null, true)
"en", "a place", null, "a description", null, "a cat", null, null, true, "entityID")
)
list.add(
Place(
@ -44,7 +44,8 @@ class BookmarkLocationControllerTest {
"another cat",
null,
null,
true
true,
"entityID"
)
)
return list

View file

@ -132,7 +132,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
val place2 = Place(
"en",
@ -143,7 +144,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
`when`(
nearbyPlaces.radiusExpander(
@ -183,7 +185,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
val place2 = Place(
"en",
@ -194,7 +197,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
`when`(
nearbyPlaces.radiusExpander(
@ -224,7 +228,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
val place2 = Place(
"en",
@ -235,7 +240,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
`when`(
nearbyPlaces.radiusExpander(
@ -275,7 +281,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
place.isMonument = true
`when`(currentLatLng.latitude).thenReturn(0.0)
@ -299,7 +306,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"picName",
false
false,
"entityID"
)
place.isMonument = false
`when`(currentLatLng.latitude).thenReturn(0.0)
@ -323,7 +331,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"",
false
false,
"entityID"
)
place.isMonument = false
`when`(currentLatLng.latitude).thenReturn(0.0)
@ -347,7 +356,8 @@ class NearbyControllerTest {
"placeCategory",
Sitelinks.Builder().build(),
"",
true
true,
"entityID"
)
place.isMonument = false
`when`(currentLatLng.latitude).thenReturn(0.0)

View file

@ -239,7 +239,7 @@ class UploadMediaPresenterTest {
fun setCorrectCountryCodeForReceivedImage() {
val germanyAsPlace =
Place(null, null, null, null, LatLng(50.1, 10.2, 1.0f), null, null, null, true)
Place(null, null, null, null, LatLng(50.1, 10.2, 1.0f), null, null, null, true, null)
germanyAsPlace.isMonument = true
whenever(