-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix for build pipeline
- Loading branch information
Showing
4 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
app/src/testShared/java/pl/marianjureczko/poszukiwacz/model/HunterPathArranger.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,12 @@ | ||
package pl.marianjureczko.poszukiwacz.model | ||
|
||
import com.ocadotechnology.gembus.test.CustomArranger | ||
import com.ocadotechnology.gembus.test.some | ||
|
||
class HunterPathArranger : CustomArranger<HunterPath>() { | ||
override fun instance(): HunterPath { | ||
val instance = super.instance() | ||
instance.addLocation(some()) | ||
return instance | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
app/src/testShared/java/pl/marianjureczko/poszukiwacz/model/RouteArranger.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,49 @@ | ||
package pl.marianjureczko.poszukiwacz.model | ||
|
||
import com.ocadotechnology.gembus.test.CustomArranger | ||
import com.ocadotechnology.gembus.test.some | ||
import com.ocadotechnology.gembus.test.someObjects | ||
import com.ocadotechnology.gembus.test.someString | ||
import pl.marianjureczko.poszukiwacz.shared.port.StorageHelper | ||
import java.io.File | ||
|
||
class RouteArranger : CustomArranger<Route>() { | ||
companion object { | ||
|
||
fun saveWithTreasureDescription(treasureDescription: TreasureDescription, storageHelper: StorageHelper): Route { | ||
val route = Route(someString(), mutableListOf(treasureDescription)) | ||
storageHelper.save(route) | ||
return route | ||
} | ||
|
||
fun savedWithTipFiles(storageHelper: StorageHelper): Route { | ||
val route = some<Route>() | ||
route.treasures.forEach { t -> | ||
t.instantiatePhotoFile(storageHelper).createNewFile() | ||
t.tipFileName = storageHelper.newSoundFile() | ||
File(t.tipFileName).createNewFile() | ||
} | ||
storageHelper.save(route) | ||
return route | ||
} | ||
|
||
fun routeWithoutTipFiles(): Route { | ||
val route = some<Route>() | ||
route.treasures.forEach { t -> | ||
t.photoFileName = null | ||
t.tipFileName = null | ||
} | ||
return route | ||
} | ||
|
||
fun withNameAndTreasureWithQrCode(name: String, qrCode: String): Route { | ||
val route = some<Route>().copy(name = name) | ||
route.treasures.first().qrCode = qrCode | ||
return route | ||
} | ||
} | ||
|
||
override fun instance(): Route { | ||
return Route(some<String>(), someObjects<TreasureDescription>(3).toMutableList()) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/testShared/java/pl/marianjureczko/poszukiwacz/model/TreasureDescriptionArranger.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,26 @@ | ||
package pl.marianjureczko.poszukiwacz.model | ||
|
||
import com.ocadotechnology.gembus.test.CustomArranger | ||
import com.ocadotechnology.gembus.test.someDouble | ||
import com.ocadotechnology.gembus.test.someFrom | ||
import com.ocadotechnology.gembus.test.someInt | ||
import com.ocadotechnology.gembus.test.somePositiveInt | ||
|
||
class TreasureDescriptionArranger : CustomArranger<TreasureDescription>() { | ||
|
||
companion object { | ||
fun validQrCode(treasureType: String = someFrom(setOf("g", "r", "d", "k"))): String { | ||
val quantity = someInt(10, 99) | ||
val id = somePositiveInt(99) | ||
return "$treasureType$quantity$id" | ||
} | ||
} | ||
|
||
override fun instance(): TreasureDescription { | ||
return super.instance().copy( | ||
qrCode = validQrCode(), | ||
latitude = someDouble(-90.0, 90.0), | ||
longitude = someDouble(-180.0, 180.0) | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/testShared/java/pl/marianjureczko/poszukiwacz/model/TreasuresProgressArranger.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,17 @@ | ||
package pl.marianjureczko.poszukiwacz.model | ||
|
||
import com.ocadotechnology.gembus.test.CustomArranger | ||
import com.ocadotechnology.gembus.test.some | ||
import com.ocadotechnology.gembus.test.someString | ||
|
||
class TreasuresProgressArranger : CustomArranger<TreasuresProgress>() { | ||
override fun instance(): TreasuresProgress { | ||
val instance = super.instance() | ||
val treasureDescription = some<TreasureDescription>() | ||
instance.routeName = someString() | ||
instance.collect(some<Treasure>(), treasureDescription) | ||
instance.addCommemorativePhoto(treasureDescription, someString()) | ||
// instance.hunterPath.addLocation(Coordinates(some<Double>() % 180, some<Double>() % 90)) | ||
return instance | ||
} | ||
} |